Debian Codegraph @

reports/marriages.ll

raw
1 /*
2 * @progname marriages
3 * @version 1.0
4 * @author Perry Rapp
5 * @category
6 * @output Text, 80 cols
7 * @description
8 *
9 * select and produce an a output report of all marriages in
10 * the database, with date of marriage if known. Sort by either
11 * spouse, or by date, or by place.
12 *
13 * Output is an ASCII file, and may be printed using 80 column format.
14 *
15 * Based on previous work by Tom Wetmore and Cliff Manis
16 *
17 * This report works only with the LifeLines Genealogy program
18 *
19 * An example of the output may be seen at end of this report.
20 */
21
22 proc main ()
23 {
24 list(mnu)
25 enqueue(mnu, "List marriages by husband")
26 enqueue(mnu, "List marriages by wife")
27 enqueue(mnu, "List marriages by either spouse")
28 enqueue(mnu, "List marriages by year")
29 enqueue(mnu, "List marriages by place")
30 set(chc, menuchoose(mnu))
31 if (eq(chc, 0)) { return(0) }
32
33 set(ct, 0) /* count #records processed */
34 set(ctx, 0) /* count module 100 for status feedback */
35
36 set(rptinterval, 100) /* report progress every this many records */
37
38 /* for choices 1-3, populate indiset of married individuals */
39 indiset(results)
40
41 /* for choices 4-5, populate list of families */
42 list(marriages)
43 list(infos)
44
45 if (gt(chc, 3)) {
46 /* Record all marriages (along with date or place) */
47 forfam(fam, n) {
48 enqueue(marriages, fam)
49 if (eq(chc, 4)) {
50 enqueue(infos, year(date(marriage(fam))))
51 } else {
52 enqueue(infos, place(marriage(fam)))
53 }
54 /* display feedback on screen */
55 incr(ct)
56 incr(ctx)
57 if (eq(ctx, rptinterval)) {
58 print(d(ct), "F ")
59 set(ctx, 0)
60 }
61 }
62 } else {
63 /* Record all married persons, of appropriate gender */
64 forindi(indi, n) {
65 if (gt(nspouses(indi), 0)) {
66 if (or(and(eq(chc, 1), male(indi)),
67 and(eq(chc, 2), female(indi)),
68 eq(chc, 3))) {
69 addtoset(results, indi, 0)
70 }
71 }
72 /* display feedback on screen */
73 incr(ct)
74 incr(ctx)
75 if (eq(ctx, rptinterval)) {
76 print(d(ct), "I ")
77 set(ctx, 0)
78 }
79 }
80 }
81 print(nl())
82 set(count, length(results))
83 if (gt(chc, 3)) { set(count, length(marriages)) }
84 print("Sorting ", d(count), " results")
85 print(nl())
86 if (gt(chc, 3)) {
87 sort(marriages, infos)
88 } else {
89 namesort(results)
90 }
91 print("ending sort")
92 print(nl())
93 col(1) "Person"
94 if (eq(chc, 5)) {
95 col(30) "Place"
96 } else {
97 col(30) "Date"
98 }
99 col(50) "Spouse"
100 col(1)
101 "-----------------------------------------"
102 "-------------------------------------"
103 if (eq(chc, 5)) {
104 forlist(marriages, fam, n) {
105 call display(husband(fam), place(marriage(fam)), wife(fam))
106 }
107 } elsif (eq(chc, 4)) {
108 forlist(marriages, fam, n) {
109 call display(husband(fam), date(marriage(fam)), wife(fam))
110 }
111 } else {
112 forindiset(results,husb,val,n) {
113 set(first, 1)
114 spouses(husb,wife,famv,m) {
115 if (first) {
116 call display(husb, date(marriage(famv)), wife)
117 set(first, 0)
118 } else {
119 call display(0, date(marriage(famv)), wife)
120 }
121 }
122 /* display feedback on screen */
123 incr(ct)
124 incr(ctx)
125 if (eq(ctx, rptinterval)) {
126 print(d(ct), "I ")
127 set(ctx, 0)
128 }
129 }
130 }
131 nl()
132 print(nl())
133 }
134
135 /*
136 Output one result row
137 */
138 proc display(husb, info, wife)
139 {
140 if (husb)
141 {
142 col(1) fullname(husb, 1,0,29)
143 }
144 col(30) trim(info, 20)
145 if (wife)
146 {
147 col(50) fullname(wife, 1,0,29)
148 }
149 }
150
151 /* Sample output of this report.
152
153 Person Date Spouse
154 ------------------------------------------------------------------------------
155 BARTH, Johann Ludwig ____, Hanna
156 BIRD, Jacob ____, Mrs.
157 BIRD, John SHRADER, Elizabeth
158 BOWERS, Anderson ABT 1828 COWAN, Lurina Viney "Vina"
159 BOWERS, James ____, Martha
160 BRADSHAW, John F. CLENDENIN, Agnes "Annie"
161 CANTER, Henry B. ____, Polina
162 CANTER, James H. 20 APR 1867 WHITEHORN, Martha Marie
163 CASON, David ca 1790 ____, Mary
164
165 */
166
167 /* End of Report */
168