| 1 |
/* |
| 2 |
* @progname gedn.ll |
| 3 |
* @version none |
| 4 |
* @author anon |
| 5 |
* @category |
| 6 |
* @output GEDCOM |
| 7 |
* @description |
| 8 |
* |
| 9 |
* The output of this report is a GEDCOM file of the following: |
| 10 |
* N generations of ancestors, |
| 11 |
* all spouses and |
| 12 |
* all children of these ancestors and |
| 13 |
* all descendents of a person, |
| 14 |
* as well as the person him/herself |
| 15 |
*/ |
| 16 |
|
| 17 |
include("ged_write.li") |
| 18 |
|
| 19 |
proc main () |
| 20 |
{ |
| 21 |
indiset(set1) /*declare an indi set*/ |
| 22 |
indiset(set2) /*declare another indi set*/ |
| 23 |
indiset(set3) /*declare another indi set*/ |
| 24 |
|
| 25 |
getindi(ind1) /*ask user to identify person*/ |
| 26 |
if(ind1) { |
| 27 |
getintmsg(maxgen, "Number of Generations") |
| 28 |
print("Finding Ancestors... ") |
| 29 |
addtoset(set1, ind1, 1) |
| 30 |
set(set2, ancestorset(set1)) |
| 31 |
print(d(lengthset(set2)), nl()) |
| 32 |
print("Triming Ancestors to ", d(maxgen), " generations... ") |
| 33 |
forindiset(set2, ind1, ival, icnt) { |
| 34 |
if(le(ival,maxgen)) { |
| 35 |
addtoset(set3, ind1, ival) |
| 36 |
} |
| 37 |
} |
| 38 |
print(d(lengthset(set3)), nl()) |
| 39 |
|
| 40 |
set(set2, spouseset(set3)) /* add their spouses */ |
| 41 |
set(set1, union(set3, set2)) /* combine set1 and set2 */ |
| 42 |
|
| 43 |
set(set2, childset(set1)) /* find everyone's children */ |
| 44 |
set(set1, union(set1, set2)) /* combine set1 and set2 */ |
| 45 |
|
| 46 |
call ged_write(set1) /* write out GEDCOM file */ |
| 47 |
} |
| 48 |
} |