home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / TextEditors&Viewers / Ced / CYGNUSED3,5.DMS / in.adf / CEDScripts / ExecuteFile.ced < prev    next >
Encoding:
Text File  |  1993-07-07  |  1.5 KB  |  44 lines

  1. /*
  2. ** ExecuteFile.ced
  3. **
  4. ** $VER: ExecuteFile.ced 1.0.1 (3.6.93)
  5. **
  6. ** This script executes the current file as a batch procedure or as a Rexx program
  7. ** if first argument is R.
  8. **
  9. ** This script requires CygnusEd Professional v3.5 (or later) to run.
  10. **
  11. ** Copyright © 1990-1993 ASDG, Incorporated  All Rights Reserved
  12. */
  13.  
  14.  
  15. TempBlock = "T:TempBlockFile"
  16.  
  17.  
  18. OPTIONS RESULTS                    /* Tell CygnusEd to return results. */
  19.  
  20.  
  21. STATUS LINENUMBER                /* Ask CygnusEd for the current line number. */
  22. CurrLine = 1 + RESULT
  23. STATUS DESIREDCOLUMN                /* Ask CygnusEd for the current column number. */
  24. CurrCol = 1 + RESULT
  25. BEG OF FILE                    /* Jump to the beginning of the current file. */
  26. MARK                        /* Mark a block. */
  27. 'END OF FILE'                    /* Jump to the end of the current file. */
  28. COPY                        /* Copy the block (the entire file in this case) to the block buffer. */
  29. SAVE CLIP AS TempBlock                /* Save the block to a temporary file. */
  30. MARK                        /* Now mark another block, */
  31. LEFT                        /* move left one and then */
  32. COPY                        /* do a copy block to purge the file from the block buffer. */
  33.                         /* This is not necessary but avoids wasting a large chunk of */
  34.                         /* memory to hold the entire file. */
  35. JUMPTO CurrLine CurrCol                /* Jump to the old cursor position. */
  36. ARG Mode
  37. IF (Mode = 'R') THEN
  38.     ADDRESS COMMAND 'Rx' TempBlock        /* Send the file to ARexx. */
  39. IF (Mode ~= 'R') THEN
  40.     ADDRESS COMMAND 'Execute' TempBlock    /* Send the file to DOS. */
  41. ADDRESS COMMAND 'Delete >NIL:' TempBlock    /* Now delete the temporary file. */
  42.  
  43. EXIT 0
  44.