home *** CD-ROM | disk | FTP | other *** search
- /*
- Demo ARexx script for QuickFile
-
- Author: Alan Wigginton
- Date: 21 March 1995
- */
-
- options results /* required to make result string available */
-
- if ~open("con","CON:20/10/400/100/ARexx/CLOSE","W") then
- exit 20
-
- call writeln("con", "QuickFile ARexx script demo")
- call writeln("con", "This requires that QuickFile be running with")
- call writeln("con", "the demo AddressBook file open. If necessary")
- call writeln("con", "open the file now")
- call writeln("con", "Enter y to continue, anything else to end")
- if upper(readln("con")) ~= "Y" then
- exit
-
- if ~show(ports,"QUICKFILE.01") then
- call ErrorProc "QuickFile.01 port not found"
-
- address "QUICKFILE.01"
-
- "setfile AddressBook"
- "wintofront" /* make sure user can see the window */
-
- /*
- Display a simple message in a requester
- --------------------------------------
- */
-
- "reqmsg 'OK - Lets load a list style view'"
-
- /*
- Load a new view and redraw display according to the view
- --------------------------------------------------------
- */
-
- "setview"
- if result ~= "AddrList.view" then
- do
- "setview AddrList.view"
- if rc = 5 then
- do
- "loadview AddrList.view"
- if rc > 0 then
- call ErrorProc "Error loading AddrList.view"
- end
- "setview AddrList.view"
- end
-
- "reqmsg 'Few database programs have a good list display'"
-
- /*
- Here is a simple search of the database. The matching records
- are placed in an index named 'Selected'
- The 'refresh' command causes an immediate redraw of the display.
- Without it, the display is not updated until the macro finishes
- */
-
- "reqmsg 'Now lets find all the Smiths using sounds like'"
-
- "newsearch Lastname sounds smith" /* set search criteria */
- "dosearch" /* find all the records */
- numfound = result /* returns number found */
- "setindex selected" /* Use the selected index */
- "refresh"
-
- /* sends reqmsg 'We found x Smiths' to QuickFile */
- /* quotes can be tricky */
-
- "reqmsg 'We found" numfound "names that sound like Smith'"
-
- "reqmsg 'Now a sort over country and name'"
- "setindex name" /* swap back to a full list */
- "sort country a lastname a firstname a"
- "refresh" /* and show the result */
- "reqmsg 'Here is the sorted list'"
-
- /*
- Now lets do some printing
- -------------------------
- */
-
- "reqmsg 'Lets print a total of records by country - to the screen'"
- "next -9999"
- "report -1 screen 'This title inserted from ARexx'"
-
- "reqmsg 'Now lets print some address labels'"
-
- "setindex name"
-
- "setview AddrLabels.view"
- if rc = 5 then
- do
- "loadview AddrLabels.view"
- if rc > 0 then
- call ErrorProc "Error loading AddrLabels.view"
- "setview AddrLabels.view"
- end
-
- "next -9999"
- "report -1 screen"
-
- "reqchoice 'This is a choice requester' 'Press a button'"
- if rc = 5 then
- "reqmsg 'You chose Cancel'"
- else
- "reqmsg 'You chose OK'"
-
- "reqmsg 'Thats all. Please excuse all the requesters'"
- exit
-
- ErrorProc:
-
- arg msg
-
- call writeln("con", msg)
- call writeln("con", "Press return to continue")
- call readln("con")
- exit
-
-
-
-