home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #3 / amigamamagazinepolishissue1998.iso / bazy / fiasco_2.1 / arexx / dummy.frx < prev    next >
Text File  |  1997-10-06  |  2KB  |  109 lines

  1. /* dummy.frx
  2.  * Skeleton script that can be used as base for ARexx scripts
  3.  * Copyright © 1997 Nils Bandener
  4.  * $VER: dummy_frx 6.7 (6.10.97)
  5.  */
  6.  
  7. /* Please specify here a name for the ARexx script:
  8.  */
  9.  
  10. scriptname = "Dummy Script"
  11.  
  12. Options Results
  13.  
  14. /*
  15.  *  If not called from Fiasco, try to address the active
  16.  *  Fiasco project
  17.  */
  18.  
  19. if ~abbrev(address(), "FIASCO.") then
  20. do
  21.     /* Get list of all available ports */
  22.  
  23.     ports = show("Ports")
  24.  
  25.     /* Search for a port of Fiasco */
  26.  
  27.     do i = 1 to words(ports)
  28.  
  29.         if abbrev(word(ports, i), "FIASCO.") then
  30.         do
  31.             /* A port of Fiasco has been found.
  32.              * Now query Fiasco to return the port
  33.              * name of the active database.
  34.              */
  35.  
  36.             Address Value word(ports, i)
  37.  
  38.             GetAttr Project Name Active ARexx
  39.  
  40.             Address Value Result
  41.  
  42.             break
  43.         end
  44.     end
  45. end
  46.  
  47. fiasco_port = address()
  48.  
  49. Signal on Syntax
  50. Signal on Halt
  51. Signal on Break_C
  52. Signal on Failure
  53.  
  54. LockGUI
  55.  
  56.  
  57. /* Code of own scripts must be inserted here.
  58.  * To exit the script, you may directly fall through to bail_out
  59.  * or call it directly.
  60.  */
  61.  
  62.  
  63. bail_out:
  64.  
  65. Address Value fiasco_port
  66.  
  67. UnlockGUI
  68. ResetStatus
  69.  
  70. exit
  71.  
  72. syntax:
  73. failure:
  74.  
  75. if show("Ports", fiasco_port) then
  76. do
  77.     Address Value fiasco_port
  78.  
  79.     RequestChoice '"Error ' || rc || ' in line ' || sigl || ':*n' || errortext(rc) || '" "Cancel" Title "' || scriptname || '"'
  80. end
  81. else
  82. do
  83.     say "Error" rc "in line" sigl ":" errortext(rc)
  84.     say "Enter to continue"
  85.     pull dummy
  86. end
  87.  
  88. call bail_out
  89.  
  90. halt:
  91. break_c:
  92.  
  93. if show("Ports", fiasco_port) then
  94. do
  95.     Address Value fiasco_port
  96.  
  97.     RequestChoice '"Script Abort Requested" "Abort Script" Title "' || scriptname || '"'
  98. end
  99. else
  100. do
  101.     say "*** Break"
  102.     say "Enter to continue"
  103.     pull dummy
  104. end
  105.  
  106. call bail_out
  107.  
  108.  
  109.