home *** CD-ROM | disk | FTP | other *** search
- /********************************************/
- /* Edit a SOURCE or NOTE file from Origins */
- /********************************************/
-
- /* This script will attempt to load the SOURCE or NOTE file requested by
- Origins into the editor of your choice. The function may be blocking or
- non-blocking by your choice. As written, and with the specified editor,
- the function is non-blocking.
-
- When Origins calls this script, it does so in a blocking manner; the
- program won't continue until the script returns. If you wish this
- behaviour, make the script block until you are done with the file.
- Otherwise, make the script return immediately.
-
- If your editor doesn't do a ScreenToFront() when called, you'll have to
- switch to the editor's screen to see it.
- */
-
- /* Enable error handling routines */
- Signal On Error
- Signal On Syntax
- Signal On Halt
- Signal On IOErr
-
- /* Change this string to the name of your editor */
- /* Make sure to include the space after the name */
- Editor = 'UEX '
-
- /* Change this string to the name of your editor's ARexx port */
- /* Always remember that port names are case-sensitive */
- MyPort = 'URexx'
-
- /* Change this string to the name of your editor's ARexx load */
- /* command. Make sure to include the space after the name. */
- Command = 'loadfile '
-
- /* Get the name of the file to edit into this variable */
- parse arg Filename
-
- /* If the editor isn't up, start it */
- If (~Show('P',MyPort)) then do
- address command 'run 'Editor Filename
- Exit
- End
-
- /* Else, set up the address */
- address value MyPort
-
- /* and tell the editor to load this file */
- Command Filename
-
- Exit
-
- /**********************************************************************/
- /* Error Handling */
- /**********************************************************************/
-
- Error:
- Parse Source Type Num MacroName Script Prog Port
- say 'ERROR: Macro "'MacroName'", Error: #'RC' ("'ErrorText(RC)'") on line 'SIGL' **'
- exit
-
- Syntax:
- Parse Source Type Num MacroName Script Prog Port
- say 'SYNTAX: Macro "'MacroName'", Error: #'RC' ("'ErrorText(RC)'") on line 'SIGL' **'
- exit
-
- Halt:
- Parse Source Type Num MacroName Script Prog Port
- say 'HALT: Macro "'MacroName'", Error: #'RC' on line 'SIGL' **'
- exit
-
- IOErr:
- Parse Source Type Num MacroName Script Prog Port
- say 'IOERR: Macro "'MacroName'", Error: #'RC' on line 'SIGL' **'
- exit
-