File: marriages.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 (168 lines) | stat: -rw-r--r-- 4,382 bytes parent folder | download | duplicates (7)
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/*
 * @progname       marriages
 * @version        1.0
 * @author         Perry Rapp
 * @category       
 * @output         Text, 80 cols
 * @description    
 *
 *   select and produce an a output report of all marriages in
 *   the database, with date of marriage if known. Sort by either
 *   spouse, or by date, or by place.
 *
 *   Output is an ASCII file, and may be printed using 80 column format.
 *
 *   Based on previous work by Tom Wetmore and Cliff Manis
 *
 *   This report works only with the LifeLines Genealogy program
 *
 *   An example of the output may be seen at end of this report.
 */

proc main ()
{
  list(mnu)
  enqueue(mnu, "List marriages by husband")
  enqueue(mnu, "List marriages by wife")
  enqueue(mnu, "List marriages by either spouse")
  enqueue(mnu, "List marriages by year")
  enqueue(mnu, "List marriages by place")
  set(chc, menuchoose(mnu))
  if (eq(chc, 0)) { return(0) }

  set(ct, 0) /* count #records processed */
  set(ctx, 0) /* count module 100 for status feedback */

  set(rptinterval, 100) /* report progress every this many records */

  /* for choices 1-3, populate indiset of married individuals */
  indiset(results)

  /* for choices 4-5, populate list of families */
  list(marriages)
  list(infos)

  if (gt(chc, 3)) {
    /* Record all marriages (along with date or place) */
    forfam(fam, n) {
      enqueue(marriages, fam)
      if (eq(chc, 4)) {
        enqueue(infos, year(date(marriage(fam))))
      } else {
        enqueue(infos, place(marriage(fam)))
      }
      /* display feedback on screen */
      incr(ct)
      incr(ctx)
      if (eq(ctx, rptinterval)) {
        print(d(ct), "F ")
        set(ctx, 0)
      }
    }
  } else {
    /* Record all married persons, of appropriate gender */
    forindi(indi, n) {
      if (gt(nspouses(indi), 0)) {
        if (or(and(eq(chc, 1), male(indi)),
               and(eq(chc, 2), female(indi)),
               eq(chc, 3))) {
          addtoset(results, indi, 0)
        }
      }
      /* display feedback on screen */
      incr(ct)
      incr(ctx)
      if (eq(ctx, rptinterval)) {
        print(d(ct), "I ")
        set(ctx, 0)
      }
    }
  }
  print(nl())
  set(count, length(results))
  if (gt(chc, 3)) { set(count, length(marriages)) }
  print("Sorting ", d(count), " results")
  print(nl())
  if (gt(chc, 3)) {
    sort(marriages, infos)
  } else {
    namesort(results)   
  }
  print("ending sort")
  print(nl())
  col(1) "Person"
  if (eq(chc, 5)) { 
    col(30) "Place"
  } else {
    col(30) "Date" 
  }
  col(50) "Spouse"
  col(1)
 	"-----------------------------------------"
 	"-------------------------------------"
  if (eq(chc, 5)) {
    forlist(marriages, fam, n) {
      call display(husband(fam), place(marriage(fam)), wife(fam))
    }
  } elsif (eq(chc, 4)) {
    forlist(marriages, fam, n) {
      call display(husband(fam), date(marriage(fam)), wife(fam))
    }
  } else {
    forindiset(results,husb,val,n) {
      set(first, 1)
      spouses(husb,wife,famv,m) {
        if (first) {
          call display(husb, date(marriage(famv)), wife)
          set(first, 0)
        } else { 
          call display(0, date(marriage(famv)), wife)
        }
      }
      /* display feedback on screen */
      incr(ct)
      incr(ctx)
      if (eq(ctx, rptinterval)) {
        print(d(ct), "I ")
        set(ctx, 0)
      }
    }
  }
  nl()
  print(nl())
}

/*
  Output one result row
*/
proc display(husb, info, wife)
{
  if (husb)
  {
    col(1) fullname(husb, 1,0,29)
  }
  col(30) trim(info, 20)
  if (wife)
  {
    col(50) fullname(wife, 1,0,29)
  }
}

/*  Sample output of this report.

Person                       Date               Spouse
------------------------------------------------------------------------------
BARTH, Johann Ludwig                             ____, Hanna
BIRD, Jacob                                      ____, Mrs.
BIRD, John                                       SHRADER, Elizabeth
BOWERS, Anderson             ABT    1828         COWAN, Lurina Viney "Vina"
BOWERS, James                                    ____, Martha
BRADSHAW, John F.                                CLENDENIN, Agnes "Annie"
CANTER, Henry B.                                 ____, Polina
CANTER, James H.             20 APR 1867         WHITEHORN, Martha Marie
CASON, David                 ca 1790             ____, Mary

*/

/* End of Report */