home *** CD-ROM | disk | FTP | other *** search
- /* dummy.frx
- * Skeleton script that can be used as base for ARexx scripts
- * Copyright © 1997-1998 Nils Bandener
- * $VER: dummy_frx 6.9 (3.8.98)
- */
-
- /* Please specify here a name for the ARexx script:
- */
-
- scriptname = "Dummy Script"
-
- Options Results
-
- /*
- * If not called from Fiasco, try to address the active
- * Fiasco project
- */
-
- if ~abbrev(address(), "FIASCO.") then
- do
- /* Get list of all available ports */
-
- ports = show("Ports")
-
- /* Search for a port of Fiasco */
-
- do i = 1 to words(ports)
-
- if abbrev(word(ports, i), "FIASCO.") then
- do
- /* A port of Fiasco has been found.
- * Now query Fiasco to return the port
- * name of the active database.
- */
-
- Address Value word(ports, i)
-
- GetAttr Project Name Active ARexx
-
- /* This command may fail when
- * no projects are active. This is
- * for example the case, when all
- * projects are hidden.
- */
-
- if rc == 0 then
- do
- Address Value Result
- end
- else
- do
- RequestChoice '"No active project" "Cancel" Title "' || scriptname || '"'
-
- call bail_out
- end
-
- break
- end
- end
- end
-
- fiasco_port = address()
-
- Signal on Syntax
- Signal on Halt
- Signal on Break_C
- Signal on Failure
-
- /* This script runs while the user cannot do anything
- * in Fiasco's GUI
- */
-
- LockGUI
-
-
- /* Code of own scripts must be inserted here.
- * To exit the script, you may directly fall through to bail_out
- * or call it directly.
- * IMPORTANT: Be sure that bail_out is executed! Otherwise,
- * the user will be locked out of Fiasco.
- */
-
-
- 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
- Address Value fiasco_port
-
- RequestChoice '"Script Abort Requested" "Abort Script" Title "' || scriptname || '"'
- end
- else
- do
- say "*** Break"
- say "Enter to continue"
- pull dummy
- end
-
- call bail_out
-
-
-