home *** CD-ROM | disk | FTP | other *** search
- /* cap.frx
- * Set the first characters of all words in a field to caps
- * Call: cap.frx <FieldID>
- * Copyright © 1996-1997 Nils Bandener
- * $VER: cap_frx 6.3 (6.10.97)
- */
-
- scriptname = "Cap.rexx"
-
- Parse Arg Field
- Options Results
-
- /*
- * If not called from Fiasco, try to address the active
- * Fiasco project
- */
-
- if ~abbrev(address(), "FIASCO.") then
- do
- ports = show("Ports")
-
- do i = 1 to words(ports)
-
- if abbrev(word(ports, i), "FIASCO.") then
- do
- Address Value word(ports, i)
-
- GetAttr Project Name Active ARexx
-
- Address Value Result
-
- break
- end
- end
- end
-
- fiasco_port = address()
-
- Signal on Syntax
- Signal on Halt
- Signal on Break_C
- Signal on Failure
-
- LockGUI
-
- GetField Field Var Cont
-
- w = words(Cont)
-
- CapCont = ""
-
- do i = 1 to w
-
- wo = word(Cont, i)
-
- if CapCont = "" then
- do
- CapCont = upper(left(wo, 1)) || substr(wo, 2)
- end
- else
- do
- CapCont = CapCont upper(left(wo, 1)) || substr(wo, 2)
- end
- end
-
- SetField Field '"' || CapCont || '"'
-
- bail_out:
-
- Address Value fiasco_port
-
- UnlockGUI
- ResetStatus
-
- exit
-
- syntax:
- failure:
-
- if show("Ports", fiasco_port) then
- do
- Address Value fiasco_port
-
- RequestChoice '"Error ' || rc || ' in line ' || sigl || ':*n' || errortext(rc) || '" "Cancel" Title "' || scriptname || '"'
- end
- else
- do
- say "Error" rc "in line" sigl ":" errortext(rc)
- say "Enter to continue"
- pull dummy
- end
-
- call bail_out
-
- halt:
- break_c:
-
- if show("Ports", fiasco_port) then
- do
- Interpret Address fiasco_port
-
- RequestChoice '"Script Abort Requested" "Cancel" Title "' || scriptname || '"'
- end
- else
- do
- say "*** Break"
- say "Enter to continue"
- pull dummy
- end
-
- call bail_out
-
-