home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************/
- /* */
- /* FamilyList.rexx */
- /* */
- /* Written by: Peter Billing, RMB 1240, Yinnar 3869, Australia */
- /* */
- /* Last saved: Wednesday 29-Sep-93 */
- /* */
- /* This program should LIST ALL the Families in the SCION database. The */
- /* database must be running for this AREXX script to work. */
- /* */
- /****************************************************************************/
-
- /* Return the Database Name */
-
- options results
- /*test = show('P','SCIONGEN')
- if test = 0 then
- say
- say "I am sorry to say that the SCION Genealogist database is not available."
- say "Please start the SCION program BEFORE using this script."
- say
- exit */
-
- myport = "SCIONGEN"
- address value myport
- getdbname
- dbname = upper(result)
- heading = "Families in the" dbname "database on" date()
- output = "STDOUT"
- say ""
- writeln(output,center("This script will give you a listing of all the",80))
- writeln(output,center(heading,80))
- writech(output,"Output to Screen or File S/F ")
- pull out
- gettotalfgrn
- total = result
- writech(stdout,"Do you want a sorted list Y/N ")
- pull sorted
- if sorted = "" then sorted = "N"
-
- if sorted = "Y" then do
- file_name = "ram:sort"
- open(sort_File,file_Name,"w")
- do x = 1 to total
- getprincipal x
- a = result
- getsex a
- sex = result
- if sex = "F" then do
- getspouse x
- a = result
- end
- getlastname a
- person = upper(result)
- getfirstname a
- person = person result x
- writeln(sort_File,person)
- end
- close(sort_file)
- address command "c:sort ram:sort ram:sort2"
- file_name = "ram:sort2"
- open(sort_File,file_Name,"r")
- end
-
- output = "STDOUT"
- code1 = "" /* Bold */
- code2 = "" /* Normal */
-
- if out = "F" then do
- code1 = "" /* Bold on */
- code2 = "" /* Bold off */
- filename = "RAM:FamilyList_"dbname".Scion"
- open(w_file,filename,"w")
- output = w_file
- writeln(stdout,"")
- writeln(stdout,"Writing file to" filename". There are" total "Families.")
- end
-
- writeln(output,center(heading,80))
- writeln(output,"")
- writeln(output,"FGRN Name of Principal IRN Name of Spouse IRN DATE")
- writeln(output, "--------------------------------------------------------------------------------")
- do j = 1 to total
- if sorted = "Y" then do
- person = readln(sort_file)
- x = word(person,words(person))
- end
- else do
- x = j
- end
- if out = "F" then do
- if j/5 = j%5 then writech(stdout,".")
- if j/55 = j%55 then do
- writeln(output, "IRN LASTNAME FIRSTNAME SEX BIRTH PLA DEATH PLA MARRIAGES PARENTS")
- writeln(output, "-----------------------------------------------------------------------------------------------------------")
- end
- end
- getprincipal x
- p = result
- MakeName(result)
- principal = name
- getspouse x
- s = result
- MakeName(result)
- spouse = name
- getsex s
- if result = "M" then do
- temp = spouse
- spouse = principal
- principal = temp
- t = s
- s = p
- p = t
- end
- getmarrydate x
- marrydate = result
- writeln(output,right(x,3) principal right(p,3)" "spouse right(s,3) right(marrydate,12))
- if out = "F" & x/5 = x%5 then writech(stdout,".")
-
- end
-
- if out = "F" then do
- writeln(output,"")
- close(w_file)
- writeln(stdout,"")
- writeln(stdout,"All Finished")
- end
-
- exit
-
- MakeName:
- parse arg irn
- getlastname irn
- name = code1 left(result,10)code2
- getfirstname irn
- name = name left(result,15)
- return name
-
-