4
* @author James P. Jones (jjones@nas.nasa.gov)
9
* This report program produces a Family Group Sheet for the selected
10
* individual, with options for generating sheets for married children
11
* of the individual, and their children, etc.
13
* This report works only with the LifeLines Genealogy program
15
* version two: 1 Nov 1992
16
* version three: 28 Mar 1993 bug fixes
17
* version four: 25 Apr 1993 added sources
18
* version five: 26 Sep 1993 added multiple indi's, bug fix
19
* version six: 3 Oct 1993 bug fixes
21
* This report program produces a Family Group Sheet for the selected
22
* individual. User is given the choice of having sheets generated for
23
* married children of individual, and the children of the children, etc.
24
* Sources of information are indicated with end-note style
25
* references. The report produces 'roff output, which I suggest you
26
* convert to postscript for the highest quality report. Following are
27
* several examples how to process and print the report (assuming the
28
* output file name is "fam.out":
30
* tbl fam.out | xroff -me -tstdout | ipr -Pim7 -D"jobheader off"
31
* tbl fam.out | xroff -me -PprinterName
32
* tbl fam.out | groff -me | your_postscript_printer
33
* tbl fam.out | troff -me | dpost | lp -dps
35
* The data in "compiler" table in main() is initialized with property's
36
* obtained from the lifelines config file (~/.linesrc on unix else
37
* lines.cfg) with values from
44
global(sourcelist) /* list of all sources used */
61
insert(compiler, "name", getproperty("user.fullname"))
62
insert(compiler, "addr", getproperty("user.address"))
63
insert(compiler, "phone", getproperty("user.phone"))
64
insert(compiler, "email", getproperty("user.email"))
67
while (eq(strcmp(name(indi), NULL), 0)) {
68
getindi(indi) /* select individual for report */
69
if (eq(strcmp(name(indi), NULL), 0)) {
70
print("Individual not found in database.")
74
while (or(lt(ionly,1), gt(ionly,2))) {
75
getintmsg(ionly,"Choose (1) Individual only, (2) + Married Descendents: ")
79
while (or(lt(sonly,1), gt(sonly,2))) {
80
getintmsg(sonly,"Choose (1) Select Spouse, (2) All Spouses: ")
86
call FGsheet(indi, ionly, sonly)
87
print("Report Done, ")
90
/* Select the individual's spouse for the Family Group Sheet.
92
proc FGsheet(indi, ionly, sonly)
95
set(i, nspouses(indi))
96
spouses(indi, svar, fvar, no) { /* display spouses */
98
if (gt(no, 7)) { /* leave space for prompt */
106
print(fullname(svar,TRUE,FALSE,50))
110
if (gt(i, 1)) { /* select a spouse */
111
getintmsg(num, "Choose which spouse for Family Report: ")
118
print(" has no spouse in database...")
122
if (eq(ONCE, TRUE)) {
132
spouses(indi, svar, fvar, no) {
133
if (or(and(eq(sonly,1), eq(no, num)), eq(sonly,2))) {
134
if (eq(strcmp(sex(indi), "F"), 0)) {
135
set(tmp, indi) /* Check sex of individual,*/
136
set(tindi, svar) /* if Female, replace with */
137
set(tsvar, tmp) /* information on husband. */
138
set(i, nspouses(tindi)) /* Easier if assume head- */
139
set(num, 1) /* of-household is male... */
141
spouses(tindi, tmps, tmpf, no) {
142
if (eq(name(tsvar), name(tmps))) {
147
call doform(tindi, tsvar, fvar, i, num)
150
call doform(indi, svar, fvar, i, num)
152
call printsources(sourcelist)
153
while (not(empty(sourcelist))) { /* NULL out sources each time */
154
set(nil, dequeue(sourcelist))
160
children(fvar, kid, j) {
161
if(or(ge(nspouses(kid),1), ge(nfamilies(kid),1))) {
162
call FGsheet(kid, ionly, 2)
170
/* Produce the Family Group Sheet form.
172
proc doform(indi, svar, fvar, numsp, cursp)
176
if (e, surname(indi)) { upper(surname(indi)) }
177
"\\0FAMILY\\0GROUP\\0SHEET" nl()
179
"Compiled by: \\fI" lookup(compiler, "name") "\\fR\\0on\\0\\fI"
183
"\\fI" lookup(compiler, "addr") "\\fR" nl()
184
"\\fIPhone:\\0" lookup(compiler, "phone") "\\0\\0\\0E-mail:\\0"
185
lookup(compiler, "email") "\\fR" nl()
189
"tab(+) expand box;" nl()
191
"Husband's Full Name:\\0\\fI"
192
if (e, name(indi)) { name(indi) "\\fR" nl() }
197
"Husband's Data+Day Month Year+City,\\0\\0Town or Place\\0\\0County or Province\\0\\0State or Country" nl()
200
set(aday, birth(indi))
201
if (e, stddate(aday)) { stddate(aday) }
203
if (e, place(aday)) { place(aday) } "\\fR"
204
if (aday) { call dosource(aday) } nl() /* note: first call to source */
207
set(aday, baptism(indi))
208
if (e, stddate(aday)) { stddate(aday) }
210
if (e, place(aday)) { place(aday) } "\\fR"
211
if (aday) { call dosource(aday) } nl()
214
set(aday, marriage(fvar))
215
if (e, stddate(aday)) { stddate(aday) }
217
if (e, place(aday)) { place(aday) } "\\fR"
218
if (aday) { call dosource(aday) } nl()
221
set(aday, death(indi))
222
if (e, stddate(aday)) { stddate(aday) }
224
if (e, place(aday)) { place(aday) } "\\fR"
225
if (aday) { call dosource(aday) } nl()
228
set(aday, burial(indi))
229
if (e, stddate(aday)) { stddate(aday) }
231
if (e, place(aday)) { place(aday) } "\\fR"
232
if (aday) { call dosource(aday) } nl()
236
"\\0Father's Name:+\\fI"
237
if (e, name(father(indi))) { name(father(indi)) "\\fR" nl() }
240
"\\0Mother's Maiden Name:+\\fI"
241
if (e, name(mother(indi))) { name(mother(indi)) "\\fR" nl() }
244
"\\0Other Wives:\\fI"
246
set(spstr, save(name(wife(fvar))))
247
spouses(indi, wifenm, tmpfvar, no) {
248
set(wstr, save(name(wifenm)))
249
if (ne(strcmp(spstr, wstr), 0)) {
256
if (eq(f, 0)) { "\\fR" nl() }
260
"tab(+) expand box;" nl()
262
"Wife's Full Maiden Name:\\0\\fI"
263
if (e, name(svar)) { name(svar) }
268
"Wife's Data +Day Month Year+City,\\0\\0Town or Place\\0\\0County or Province\\0\\0State or Country" nl()
271
set(aday, birth(svar))
272
if (e, stddate(aday)) { stddate(aday) }
274
if (e, place(aday)) { place(aday) } "\\fR"
275
if (aday) { call dosource(aday) } nl()
278
set(aday, baptism(svar))
279
if (e, stddate(aday)) { stddate(aday) }
281
if (e, place(aday)) { place(aday) } "\\fR"
282
if (aday) { call dosource(aday) } nl()
285
set(aday, death(svar))
286
if (e, stddate(aday)) { stddate(aday) }
288
if (e, place(aday)) { place(aday) } "\\fR"
289
if (aday) { call dosource(aday) } nl()
292
set(aday, burial(svar))
293
if (e, stddate(aday)) { stddate(aday) }
295
if (e, place(aday)) { place(aday) } "\\fR"
296
if (aday) { call dosource(aday) } nl()
300
"\\0Father's Name:+\\fI"
301
if (e, name(father(svar))) { name(father(svar)) "\\fR" nl() }
304
"\\0Mother's Maiden Name:+\\fI"
305
if (e, name(mother(svar))) { name(mother(svar)) "\\fR" nl() }
308
"\\0Other Husbands:\\fI"
310
set(spstr, save(name(indi)))
311
spouses(svar, hubby, tmpfvar, no) {
312
set(hstr, save(name(hubby)))
313
if (ne(strcmp(spstr, hstr), 0)) {
320
if (eq(f, 0)) { "\\fR" nl() }
323
/* now for the children... */
325
children(fvar, cvar, no) {
326
if (eq(haschild, 1)) {
328
"tab(+) expand box;" nl()
329
"l |l| l | l | l." nl()
330
"Complete Names of All Children+Sex+Event+Date+"
331
"City, Town, County, State or Country" nl()
336
if (or(eq(no, 4), eq(no, 12))) { /* If 4th or 12th kid, start */
337
".TE" nl() /* a new page. There was an */
338
".bp" nl() /* old woman, who lived in a */
339
".TS" nl() /* shoe, she had so many kids... */
340
"tab(+) expand box;" nl()
341
"l |l| l | l | l." nl()
342
"Complete Names of All Children+Sex+Event+Date+"
343
"City, Town, County/Province, State, Country" nl()
350
if (e, name(cvar)) { name(cvar) }
355
set(aday, birth(cvar))
356
if (e, stddate(aday)) { stddate(aday) }
358
if (e, place(aday)) { place(aday) } "\\fR"
359
if (aday) { call dosource(aday) } nl()
362
set(aday, death(cvar))
363
if (e, stddate(aday)) { stddate(aday) }
365
if (e, place(aday)) { place(aday) } "\\fR"
366
if (aday) { call dosource(aday) } nl()
368
"\\^+\\^+Burial+\\fI"
369
set(aday, burial(cvar))
370
if (e, stddate(aday)) { stddate(aday) }
372
if (e, place(aday)) { place(aday) } "\\fR"
373
if (aday) { call dosource(aday) } nl()
375
families(cvar, cfvar, csvar, no) { /* spouses */
377
"\\^+\\^+Marriage+\\fI"
378
set(aday, marriage(cfvar))
379
if (e, stddate(aday)) { stddate(aday) }
381
if (e, name(csvar)) { name(csvar) }
382
if (aday) { call dosource(aday) }
387
if (eq(haschild, 2)) {
393
/* Short macro procedure to combine SOURCE and SOURCENUM calls, to shorten
396
proc dosource(eventnode)
398
call source(eventnode) /* get source of data */
399
if (sourcestr) { /* if source not NULL */
400
call sourcenum() /* print source number */
404
/* Retrieve source from a given event (EVENTNODE), and save it in the global
407
proc source(eventnode)
410
traverse(eventnode, node, lev) {
411
if (eq(strcmp(tag(node), "SOUR"), 0)) {
412
set(sourcestr, value(node))
417
/* Create a "List of Sources" table for the report; in the report itself,
418
* print only a footnote number, and later the list these number refer to
419
* can be printed (via PRINTSOURCES).
424
forlist(sourcelist, item, i) {
426
if (eq(strcmp(item, sourcestr), 0)) { /* if source in list */
427
" \\s7(" d(i) ")\\s8" /* print out source index */
431
if (not(eq(found, 1))) {
432
push(sourcelist, sourcestr) /* otherwise add it to list */
433
" \\s7(" d(add(numsources,i,1)) ")\\s8" /* and print source index */
437
/* Print a list of all the sources refered to in the document. The numbers
438
* preceeding each source entry are what the in-line references refer to.
440
proc printsources(slist)
442
if (not(empty(slist))) {
444
"LIST OF SOURCES REFERENCED IN THIS REPORT" nl()
446
forlist(slist, item, i) {
447
"(" d(i) ") " item nl()