home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd2.bin / bbs / gfx / megajitter-1.3.lha / MegaJitter / REXX / MSC < prev   
Text File  |  1994-05-18  |  2KB  |  70 lines

  1. /****************************************************************************
  2. *    
  3. *    MegaJitter SET SCENARIO                                    (c) LVA 1994 
  4. *    -----------------------                                    ------------
  5. *    
  6. *    This AREXX program takes the name of a MegaJitter SCENARIO file.
  7. *    These scenario files are actually also AREXX programs which address Mega-
  8. *    Jitter as a host and send them parameter change requests to configure an
  9. *    Ecosystem scenario; then they request a restart command.
  10. *    
  11. *    This file contains the common startup and error handling code.
  12. *    
  13. ****************************************************************************/
  14.  
  15. SAY 'MegaJitter SET SCENARIO V1.0 (c) LVA 1994'
  16. SAY '-----------------------'
  17. SAY
  18.  
  19. OPTIONS FAILAT 100000
  20. SIGNAL ON ERROR
  21. SIGNAL ON BREAK_C
  22.  
  23. ARG scenario                            /* command line requires a filename */
  24.  
  25. IF scenario = '' | scenario = '?' THEN DO
  26.     SAY "Usage: MSC <scenario> | ?"
  27.     SAY
  28.     IF scenario = '' THEN SAY "ERROR: no scenario file specified."
  29.     EXIT
  30. END
  31.  
  32. IF ~EXISTS(scenario) THEN DO
  33.     SAY "ERROR: Scenario file" scenario "not found !"
  34.     EXIT
  35. END
  36.  
  37. host_ok = SHOW("PORTS","REXX-MJ")        /* is MegaJitter already running ? */
  38.  
  39. IF ~host_ok THEN DO
  40.     SAY "ERROR: MegaJitter is not running. Please start MegaJitter first."
  41.     EXIT
  42. END
  43.  
  44. SAY "Setting new MegaJitter scenario:" scenario "..."
  45.  
  46. /* The next line goes off to execute the REXX sub-program (file) */
  47.  
  48. scenario
  49.  
  50. SAY "Done."
  51.  
  52. EXIT
  53.  
  54. /* ------------------------------------------------------------------------ */
  55.  
  56. ERROR:
  57.     say "An error was returned by MegaJitter (ERROR RC =" RC
  58.     say "check line #" SIGL
  59.     say "------------------------------------------------"
  60.     say sourceline(SIGL)
  61.     say "------------------------------------------------"
  62.     EXIT
  63.  
  64. /* ------------------------------------------------------------------------ */
  65.  
  66. BREAK_C:  
  67.     SAY "^C *** PROGRAM ABORTED ***"
  68.     EXIT
  69. /* ------------------------------------------------------------------------ */
  70.