home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / text / edit / macro / amigae / ec_optrun.rexx < prev    next >
OS/2 REXX Batch file  |  1994-11-03  |  1KB  |  39 lines

  1. /* $VER: 1.0, ©1994 BURGHARD Eric.                  */
  2. /*           Request executable arguments           */
  3.  
  4. options results                             /* enable return codes     */
  5.                                             /* not started by GoldEd ? */
  6. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then address 'GOLDED.1'
  7. 'LOCK CURRENT QUIET'                        /* lock GUI, gain access   */
  8. if rc then exit
  9. options failat 6                            /* ignore warnings         */
  10. signal on syntax                            /* ensure clean exit       */
  11.  
  12. 'QUERY FILE VAR NAME'
  13. if (upper(right(name,2)))='.E' then do
  14.   name=left(name,length(name)-2)
  15.   if ~exists("T:E") then address command 'Makedir T:E'
  16.   if exists('T:E/'name'.opt') then do
  17.     ok=open(fhandle,'T:E/'name'.opt',"read")
  18.     runopt=readln(fhandle)
  19.     ok=close(fhandle)
  20.   end
  21.   else runopt=""
  22.   'REQUEST TITLE="Executable args" BODY="Enter Arguments" STRING OLD="'runopt'"'
  23.   runopt=result
  24.   if rc==0 then do
  25.     ok=open(fhandle,'T:E/'name'.opt',"write")
  26.     ok=writeln(fhandle,runopt)
  27.     ok=close(fhandle)
  28.   end
  29. end
  30. else 'REQUEST STATUS=" E Sources names must end with '.e'"'
  31. 'UNLOCK'
  32. exit
  33.  
  34. syntax:
  35. say "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  36. 'UNLOCK'
  37. exit
  38.  
  39.