| 1 |
/* |
| 2 |
* @progname index_mm.ll |
| 3 |
* @version 4.0 |
| 4 |
* @author Eggert |
| 5 |
* @category |
| 6 |
* @output Text |
| 7 |
* @description |
| 8 |
|
| 9 |
This program lists everyone in a database, with women listed by both |
| 10 |
maiden name and married name. It assumes that all women take the surname |
| 11 |
of their husbands, which is not always correct. |
| 12 |
|
| 13 |
index_mm - a LifeLines database listing program |
| 14 |
by Jim Eggert ([email protected]) |
| 15 |
Version 1, 25 November 1992 |
| 16 |
Version 2, 29 November 1992 (gave up on bubblesort) |
| 17 |
Version 3, 11 January 1993 (added deathdate and marriage) |
| 18 |
Version 4, 18 April 1993 (bug fix, made namewidth variable) |
| 19 |
|
| 20 |
To sort the resulting report by name, enter the Unix command |
| 21 |
sort -b +1 report > sorted.report |
| 22 |
*/ |
| 23 |
|
| 24 |
|
| 25 |
proc main () |
| 26 |
{ |
| 27 |
list(names) |
| 28 |
list(keys) |
| 29 |
list(indices) |
| 30 |
|
| 31 |
set(namewidth,40) /* change this value as needed */ |
| 32 |
|
| 33 |
". ." col(8) "LAST, First Middle [MAIDEN]" |
| 34 |
set(bcol,add(8,namewidth)) |
| 35 |
col(bcol) "Birthdate" |
| 36 |
set(dcol,add(22,namewidth)) |
| 37 |
col(dcol) "Deathdate" |
| 38 |
set(mcol,add(36,namewidth)) |
| 39 |
col(mcol) "Marriage" |
| 40 |
|
| 41 |
set(marriednum,0) |
| 42 |
print("Writing names...") |
| 43 |
set(nextrep,0) |
| 44 |
forindi(person,num) { |
| 45 |
if (ge(num,nextrep)) { |
| 46 |
print(d(num)) print(" ") |
| 47 |
set(nextrep,add(nextrep,100)) |
| 48 |
} |
| 49 |
if (b,birth(person)) { set(bdate,date(b)) } |
| 50 |
else { set(bdate,date(baptism(person))) } |
| 51 |
if (d,death(person)) { set(ddate,date(d)) } |
| 52 |
else { set(ddate,date(burial(person))) } |
| 53 |
key(person) col(8) fullname(person,1,0,namewidth) |
| 54 |
col(bcol) bdate col(dcol) ddate |
| 55 |
families(person,fam,spouse,fnum) { |
| 56 |
if (eq(fnum,1)) { |
| 57 |
col(mcol) date(marriage(fam)) |
| 58 |
} |
| 59 |
} |
| 60 |
nl() |
| 61 |
if (female(person)) { |
| 62 |
set(maidenname,save(concat(", ",fullname(person,1,1,100)))) |
| 63 |
spouses(person,spouse,fam,fnum) { |
| 64 |
if (spousesurname,surname(spouse)) { |
| 65 |
set(mdate,date(marriage(fam))) |
| 66 |
key(person) col(8) |
| 67 |
trim(concat(upper(spousesurname),maidenname),namewidth) |
| 68 |
col(bcol) bdate col(dcol) ddate col(mcol) mdate nl() |
| 69 |
set(marriednum,add(marriednum,1)) |
| 70 |
} |
| 71 |
} |
| 72 |
} |
| 73 |
} |
| 74 |
print("\nWrote ") print(d(num)) print(" database names and ") |
| 75 |
print(d(marriednum)) print(" married names.\n") |
| 76 |
} |