File: givens_gender_finder.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 (34 lines) | stat: -rw-r--r-- 1,069 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
/*
 * @progname       givens_gender_finder.ll
 * @version        1
 * @author         Eggert
 * @category       
 * @output         Text
 * @description    

This program finds all persons with a particular given name and gender.
It is really meant to be a companion to the givens_gender program.

givens_gender_finder - a LifeLines database given name & gender finder program
        by Jim Eggert (eggertj@ll.mit.edu)
        Version 1 (19 April 1995) requires LifeLines 3.0.1 or later.

*/

proc main() {
    list(names)
    getstrmsg(nseek,"Enter name to be found") set(nseek,save(nseek))
    getstrmsg(gseek,"Enter gender to be found") set(gseek,save(gseek))
    forindi(person,pnum) {
        if (not(strcmp(gseek,sex(person)))) {
            extractnames(inode(person),names,nnames,isurname)
            forlist(names,name,iname) {
                if (ne(iname,isurname)) {
                    if (not(strcmp(name,nseek))) {
                        print(key(person)," ",name(person),"\n")
                    }
                }
            }
        }
    }
}