File: pedigree.ll

package info (click to toggle)
lifelines 3.0.50-2
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 11,140 kB
  • ctags: 6,517
  • sloc: ansic: 57,468; xml: 8,014; sh: 4,255; makefile: 848; yacc: 601; perl: 170; sed: 16
file content (77 lines) | stat: -rw-r--r-- 2,207 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
 * @progname       pedigree.ll
 * @version        none
 * @author         Wetmore, Manis, Hume Smith
 * @category       
 * @output         Text
 * @description
 *
 *   Select and produce an ancestor report for the person selected.
 *
 *   Code by Tom Wetmore, ttw@cbnewsl.att.com
 *   With modifications by:  Cliff Manis
 *   more by Hume Smith (who refuses to learn YACL and so may do odd things):
 *   - optional depth limit
 *   - draws helpful lines
 *
 *   This report works only with the LifeLines Genealogy program
 *
 *   version one of this report was written by Tom Wetmore, in 1990,
 *   name is from pedigreel  (long format)
 *
 *   Output is an ASCII file, and will probably need to be printed
 *   using 132 column format.  Sample (depth 2):

    +!
  +-Ivan Cottnam "Cott" SMITH (10 Jan 1932- ) #2
  | +!
+-Hume Cottnam Llewellyn SMITH (18 Dec 1966- ) #1
  | +!
  +-Gail Ida HUME (26 Mar 1943- ) #3
    +!

 * ! indicates more is known beyond that depth.
 */

proc main ()
{
        getindi(indi)
        getintmsg(depth,"How many generations (-1 for all)?")
    dayformat(0)
    monthformat(4)
    dateformat(0)
        call pedigree(1, depth, indi, "", "  ", "  ")
}

proc pedigree (ah, depth, indi, indent, above, below)
{
        if (eq(depth,0)) {
                indent "+!" nl()
        } else {
                if (par, father(indi)) {
                        call pedigree(mul(2,ah), sub(depth,1), par, concat(indent, above), "  ", "| ")
                }

                indent "+-"
                fullname(indi,1,1,50)
                set(flag,0)
                set(birth," ")
                set(death," ")
                if (evt, birth(indi)) {
                        set(flag,1)
                        set(birth, stddate(evt))
                }
                if (evt, death(indi)) {
                        set(flag,1)
                        set(death, stddate(evt))
                }
                if (flag) { " (" birth "-" death ")" }
                " #" d(ah) nl()

                if (par, mother(indi)) {
                        call pedigree(add(1,mul(2,ah)), sub(depth,1), par, concat(indent, below), "| ", "  ")
                }
        }
}

/* eof */