| 1 |
/* |
| 2 |
* @progname select.ll |
| 3 |
* @version 3 |
| 4 |
* @author Wetmore, Groleau, McGee |
| 5 |
* @category |
| 6 |
* @output Custom |
| 7 |
* @description |
| 8 |
|
| 9 |
Customizable report stub to do the following: |
| 10 |
o Select a person with all ancestors and all descendents. |
| 11 |
o Add to selection all other persons within a user-specified number of |
| 12 |
links from any person in the first selection. |
| 13 |
o Turn the selected set of persons into a list |
| 14 |
o Call a report subprogram to process the list. |
| 15 |
|
| 16 |
WRITTEN BY TOM WETMORE, 21 Jul 1995 |
| 17 |
minor mods by Wes Groleau, 25 Aug 1995 |
| 18 |
Scott McGee fixed Wes's bug, 26 Aug 1995 :-) |
| 19 |
*/ |
| 20 |
|
| 21 |
list(o) /* output list */ |
| 22 |
|
| 23 |
/* have user provide start person and link distance */ |
| 24 |
|
| 25 |
getindi(i, "Please identify start person.") |
| 26 |
if (not(i)) { return() } |
| 27 |
getint(n, "Please enter link distance.") |
| 28 |
|
| 29 |
/* create set with all ancestors and descendents */ |
| 30 |
|
| 31 |
indiset(s) addtoset(s, i, 1) |
| 32 |
indiset(a) set(a, ancestorset(s)) /* could be made optional */ |
| 33 |
indiset(d) set(d, descendentset(s)) /* could be made optional */ |
| 34 |
set(s, union(s, union(a, d))) |
| 35 |
|
| 36 |
/* create set of additional, linked-to persons */ |
| 37 |
|
| 38 |
indiset(t) set(t, spouseset(s)) |
| 39 |
set(n, sub(n, 1)) |
| 40 |
while (gt(n, 0)) { |
| 41 |
set(a, parentset(t)) |
| 42 |
set(d, childset(t)) |
| 43 |
set(b, siblingset(t)) |
| 44 |
set(c, spouseset(t)) |
| 45 |
set(t, union(t, union(a, union(d, union(b, c))))) |
| 46 |
set(n, sub(n, 1)) |
| 47 |
} |
| 48 |
|
| 49 |
/* create final set of all selected persons and generate the report */ |
| 50 |
|
| 51 |
set(s, union(s, t)) |
| 52 |
|
| 53 |
if(s){ |
| 54 |
forindiset(s, j, n, m) { |
| 55 |
enqueue(o, j) |
| 56 |
} |
| 57 |
} |
| 58 |
|
| 59 |
call do_list(o) /* your routine here */ |
| 60 |
} |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
proc do_list (o) { /* your routine here */ } |