| 1 |
/* |
| 2 |
* @progname refn.ll |
| 3 |
* @version 1.0 |
| 4 |
* @author Larry Hamilton |
| 5 |
* @category |
| 6 |
* @output Text |
| 7 |
* @description Report of all User Reference Numbers (REFN). |
| 8 |
|
| 9 |
Prints out the value of all the lines in your database with the REFN tag, |
| 10 |
along with enough information so you can find the line easily. The purpose |
| 11 |
of this report is so you can find all the REFNs, and double-check them for |
| 12 |
duplicates. |
| 13 |
|
| 14 |
* Modified from Olsen, Eggert - places.ll |
| 15 |
* |
| 16 |
* by Larry Hamilton ([email protected]) |
| 17 |
* Version 1.0, November 10, 2005 |
| 18 |
* |
| 19 |
* The REFNs are printed out in the order that they appear in the database. |
| 20 |
* |
| 21 |
* To sort the output: |
| 22 |
* on Unix\Linux: sort -f originalfilename -o sortedfilename |
| 23 |
* on Windows: sort originalfilename /O sortedfilename |
| 24 |
* |
| 25 |
*/ |
| 26 |
|
| 27 |
proc main() |
| 28 |
{ |
| 29 |
list(tag_stack) |
| 30 |
|
| 31 |
print("Printing all REFNs.\n") |
| 32 |
print("Be patient. This may take a while.\n\n") |
| 33 |
print("If there are no REFNs in the database,\nthere will not be a prompt for an output file name.\n") |
| 34 |
|
| 35 |
forindi (person, id) { |
| 36 |
|
| 37 |
traverse (inode(person), node, level) { |
| 38 |
|
| 39 |
setel(tag_stack, add(level, 1), tag(node)) |
| 40 |
|
| 41 |
if (eq(strcmp(tag(node), "REFN"), 0)) { |
| 42 |
tag(node) " " value(node) " | " key(person) " " name(person) |
| 43 |
forlist (tag_stack, tag, tag_number) { |
| 44 |
if (and(gt(tag_number, 1), le(tag_number, level))) { " " tag } |
| 45 |
} |
| 46 |
"\n" |
| 47 |
} |
| 48 |
} |
| 49 |
} |
| 50 |
|
| 51 |
forfam (fam, fnum) { |
| 52 |
|
| 53 |
traverse (fnode(fam), node, level) { |
| 54 |
setel(tag_stack, add(level, 1), tag(node)) |
| 55 |
|
| 56 |
if (eq(strcmp(tag(node), "REFN"), 0)) { |
| 57 |
tag(node) " " value(node) " | " key(fam) " (" |
| 58 |
if (person,husband(fam)) { set(relation,", husb") } |
| 59 |
elsif (person,wife(fam)) { set(relation,", wife") } |
| 60 |
else { |
| 61 |
children(fam,child,cnum) { |
| 62 |
if (eq(cnum,1)) { |
| 63 |
set(person,child) |
| 64 |
set(relation,", chil") |
| 65 |
} |
| 66 |
} |
| 67 |
} |
| 68 |
if (person) { |
| 69 |
key(person) " " name(person) relation |
| 70 |
} |
| 71 |
") |" |
| 72 |
forlist (tag_stack, tag, tag_number) { |
| 73 |
if (and(gt(tag_number, 1), le(tag_number, level))) { " " tag } |
| 74 |
} |
| 75 |
"\n" |
| 76 |
} |
| 77 |
} |
| 78 |
} |
| 79 |
} |