home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************/
- /* */
- /* FixPlaceNames.rexx */
- /* */
- /* Written by: Peter Billing, RMB 1240, Yinnar 3869, Australia */
- /* */
- /* Last saved: Wednesday 29-Sep-93 */
- /* */
- /* This script should FIND and REPLACE a given PLACE name in the SCION */
- /* database. It will check Birth, Death, Burial and Marriage place names. */
- /* */
- /****************************************************************************/
-
- 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)
- f = "STDOUT"
- say ""
- say "Current database name is " dbname
- say
- say "This script will FIND and REPLACE Birth, Death, Burial"
- say "and Marriage place names with a new one supplied by you."
- say "Just press RETURN to exit."
- say
- writech(f,"What PLACE name you would like replaced? ")
- pull findname
- if findname = "" then exit
- capit(findname)
- findname = new
- say
- say "EVERYTHING after and including" findname "will be deleted"
- writech(f,"What is the replacement PLACE name? ")
- pull replacename
- say
- capit(replacename)
- replacename = new
-
- gettotalirn
- total = result
- z = total*3
- gettotalfgrn
- z = z + result
- writeln(f,"Hang on a moment. There are" z "place names to check.")
- t=0
- do x = 1 to total
- getbirthplace x
- call fixplace(result)
- putbirthplace x name
- getdeathplace x
- call fixplace(result)
- putdeathplace x name
- getburialplace x
- call fixplace(result)
- putburialplace x name
- if x/5 = x%5 then writech(stdout,".")
- end
- say
- say "I changed a total of "t" birth, death and burial places"
-
- gettotalfgrn
- total = result
- t=0
- do x = 1 to total
- getmarryplace x
- call fixplace(result)
- marryplace = name
- putmarryplace x marryplace
- if x/5 = x%5 then writech(stdout,".")
- end
- say
- say "and I also changed "t" marriage places"
- say
- say "Do not forget to SAVE the new" dbname "database."
- say
- exit
-
- fixplace:
- parse arg name
- a = 0
- a = pos(findname,name)
- if a > 0 then do
- name = delstr(name,a)
- name = insert(replacename,name,a-1)
- t = t + 1
- end
- return name t
-
- capit:
- parse arg w
- new = ""
- new = insert(new , upper(substr(w,1,1)))
- do j = 2 to length(w)
- p = substr(w,j,1)
- if substr(w,j-1,1) = " " then do
- new = insert(new , upper(p))
- end
- else do
- if substr(w,j-1,1) = " " then do
- new = insert(new , upper(p))
- end
- else do
- if datatype(p,upper) then do
- x = c2d(p)+32
- new = insert(new , d2c(x))
- end
- else
- new = insert(new , p)
- end
- end
- end
- return new
-
-