home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************/
- /* */
- /* PeopleList.rexx */
- /* */
- /* Written by: Peter Billing, RMB 1240, Yinnar 3869, Australia */
- /* */
- /* Last saved: Wednesday 29-Sep-93 */
- /* */
- /* This program should LIST ALL the people 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 = result
- output = "STDOUT"
- heading = "Listing of ALL the people in the" dbname "database on" date()
- say ""
- writeln(output,center("This script will give you a",80))
- writeln(output,center(heading,80))
- say center("The screen output DOES NOT include marriages",80)
- say center("but the file option does. This makes the line longer",80)
- say center("than 80 characters so it will need to be printed in",80)
- say center("compressed mode.",80)
- writech(stdout,"Output to Screen or File S/F ")
- pull out
- if out = "" then out = "S"
- writech(stdout,"Do you want a sorted list Y/N ")
- pull sorted
- if sorted = "" then sorted = "N"
- maximum = 0
- do number = 1 to 100
- nametable.number = ""
- end
- gettotalirn
- total = result
-
- /* total = 12 */
-
- if sorted = "Y" then do
- file_name = "ram:sort"
- open(sort_File,file_Name,"w")
- do a = 1 to total
- getlastname a
- person = upper(result)
- getfirstname a
- person = person result a
- 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
-
- if out = "S" then do
- output = "STDOUT"
- cen = 80
- end
- if out = "F" then do
- filename = "RAM:PeopleList_"dbname".Scion"
- open(w_file,filename,"w")
- output = w_file
- writeln(stdout,"")
- writeln(stdout,"Writing file to" filename)
- cen = 106
- end
-
- writeln(output,"w" center(heading,cen))
- writeln(output,"")
- if out = "F" then do
- writeln(output, "IRN LASTNAME FIRSTNAME SEX BIRTH PLA DEATH PLA MARRIAGES PARENTS")
- writeln(output, "-----------------------------------------------------------------------------------------------------------")
- end
- else do
- writeln(output, "IRN LASTNAME FIRSTNAME SEX BIRTH PLA DEATH PLA PARENTS")
- writeln(output, " -------------------------------------------------------------------------")
- end
- do i = 1 to total
- if sorted = "Y" then do
- person = readln(sort_file)
- x = word(person,words(person))
- end
- else do
- x = i
- end
- if out = "F" then do
- if i/5 = i%5 then writech(stdout,".")
- if i/55 = i%55 then do
- writeln(output,"" center(heading,cen))
- writeln(output,"")
- writeln(output, "IRN LASTNAME FIRSTNAME SEX BIRTH PLA DEATH PLA MARRIAGES PARENTS")
- writeln(output, "-----------------------------------------------------------------------------------------------------------")
- end
- end
- getlastname x
- lastname = result
- getfirstname x
- firstname = result
- getsex x
- sex = result
- getbirthdate x
- birthdate = result
- getdeathdate x
- deathdate = result
- getparents x
- parents = result
- getprincipal parents
- principal = result
- getspouse parents
- spouse = result
- getbirthplace x
- makeplacenumber(result)
- birthplace = number
- getdeathplace x
- makeplacenumber(result)
- deathplace = number
- if out = "F" then do
- writech(output, right(x,3) left(lastname,15) left(firstname,25) left(sex,2) right(birthdate,10) right(birthplace,3) right(deathdate,10) right(deathplace,3))
- end
- else do
- writech(output, right(x,3) left(lastname,12) left(firstname,15) left(sex,2) right(birthdate,10) right(birthplace,3) right(deathdate,10) right(deathplace,3))
- end
- if out = "F" then do
- do f = 0 to 4
- getmarriage x f
- writech(output,right(result,4))
- end
- end
- writeln(output,right(principal,4) right(spouse,4))
- end
-
- gettotalfgrn
- total = result
- if out = "F" then do
- writeln(stdout,"")
- writeln(stdout,"Writing Marriages")
- writeln(output,"")
- end
- writeln(output,centre("Marriages",cen))
- writeln(output,"")
- writeln(output,"FGRN DATE PLA HUSB WIFE FGRN DATE PLA HUSB WIFE")
- do x = 1 to (total + 1) / 2
- a = (total + 1) % 2 + x
- /* say x a */
- if out = "F" then do
- if x/5 = x%5 then writech(stdout,".")
- if x/55 = x%55 then do
- writeln(output,"" center(heading,cen))
- writeln(output,"")
- writeln(output,centre("Marriages",cen))
- writeln(output,"")
- writeln(output,"FGRN DATE PLA HUSB WIFE FGRN DATE PLA HUSB WIFE")
- end
- end
- getmarrydate x
- marrydate = result
- getmarryplace x
- makeplacenumber(result)
- marryplace = number
- getprincipal x
- principal = result
- getspouse x
- spouse = result
- writech(output,right(x,4) right(marrydate,12) right(marryplace,4) right(principal,4) right(spouse,4))
- getmarrydate a
- marrydate = result
- getmarryplace a
- makeplacenumber(result)
- marryplace = number
- getprincipal a
- principal = result
- getspouse a
- spouse = result
- writeln(output,right(a,22) right(marrydate,12) right(marryplace,4) right(principal,4) right(spouse,4))
- end
-
- if out = "F" then writeln(output,"")
- writeln(output,center(heading,cen))
- writeln(output,"")
- writeln(output,center("Place Names",cen))
- writeln(output,"")
- do x = 1 to (maximum + 1) / 2
- a = (maximum + 1) % 2+x
- if out = "F" then do
- writeln(output,right(x,4) left(nametable.x,50) right(a,4) left(nametable.a,50))
- end
- else do
- writeln(output,right(x,4) left(nametable.x,32) right(a,4) left(nametable.a,32))
- end
- if out = "F" then do
- if x/55 = x%55 then do
- writeln(output,"" center(heading,cen))
- writeln(output,"")
- writeln(output,center("Place Names",cen))
- writeln(output,"")
- end
- end
- end
-
- if out = "F" then do
- writeln(output,"")
- close(w_file)
- writeln(stdout,"")
- writeln(stdout,"All Finished")
- end
-
- exit
-
-
- MakePlaceNumber:
- parse arg name
- number = 0
- /* nametable.3 = "" */
- /* say name
- say nametable.number */
- do until nametable.number = "" | nametable.number = name
- number = number +1
- if number > maximum then maximum = number
- end
- if nametable.number = "" then do
- nametable.number = name
- end
-
- if name = "" then number = ""
- return number
-
-