home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / demos / commerci / origins.lzh / ARexx / EditGen.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1992-09-16  |  2.4 KB  |  77 lines

  1. /********************************************/
  2. /* Edit a SOURCE or NOTE file from Origins */
  3. /********************************************/
  4.  
  5. /* This script will attempt to load the SOURCE or NOTE file requested by
  6.    Origins into the editor of your choice.  The function may be blocking or
  7.    non-blocking by your choice.  As written, and with the specified editor,
  8.    the function is non-blocking.
  9.  
  10.    When Origins calls this script, it does so in a blocking manner; the
  11.    program won't continue until the script returns.  If you wish this
  12.    behaviour, make the script block until you are done with the file.
  13.    Otherwise, make the script return immediately.
  14.  
  15.    If your editor doesn't do a ScreenToFront() when called, you'll have to
  16.    switch to the editor's screen to see it.
  17. */
  18.  
  19. /* Enable error handling routines */
  20. Signal On Error
  21. Signal On Syntax
  22. Signal On Halt
  23. Signal On IOErr
  24.  
  25. /* Change this string to the name of your editor */
  26. /* Make sure to include the space after the name */
  27. Editor = 'UEX '
  28.  
  29. /* Change this string to the name of your editor's ARexx port */
  30. /*     Always remember that port names are case-sensitive     */
  31. MyPort = 'URexx'
  32.  
  33. /* Change this string to the name of your editor's ARexx load */
  34. /* command.  Make sure to include the space after the name.   */
  35. Command = 'loadfile '
  36.  
  37. /* Get the name of the file to edit into this variable */
  38. parse arg Filename
  39.  
  40. /* If the editor isn't up, start it */
  41. If (~Show('P',MyPort)) then do
  42.     address command 'run 'Editor Filename
  43.     Exit
  44. End
  45.  
  46. /* Else, set up the address */
  47. address value MyPort
  48.  
  49. /* and tell the editor to load this file */
  50. Command Filename
  51.  
  52. Exit
  53.  
  54. /**********************************************************************/
  55. /*                           Error Handling                           */
  56. /**********************************************************************/
  57.  
  58. Error:
  59.     Parse Source Type Num MacroName Script Prog Port
  60.     say 'ERROR: Macro "'MacroName'", Error: #'RC' ("'ErrorText(RC)'") on line 'SIGL' **'
  61.     exit
  62.  
  63. Syntax:
  64.     Parse Source Type Num MacroName Script Prog Port
  65.     say 'SYNTAX: Macro "'MacroName'", Error: #'RC' ("'ErrorText(RC)'") on line 'SIGL' **'
  66.     exit
  67.  
  68. Halt:
  69.     Parse Source Type Num MacroName Script Prog Port
  70.     say 'HALT: Macro "'MacroName'", Error: #'RC' on line 'SIGL' **'
  71.     exit
  72.  
  73. IOErr:
  74.     Parse Source Type Num MacroName Script Prog Port
  75.     say 'IOERR: Macro "'MacroName'", Error: #'RC' on line 'SIGL' **'
  76.     exit
  77.