home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / ADPro251-3.DMS / ADPro251-3.adf / ADProScripts.lha / F0.adpro < prev    next >
Encoding:
Text File  |  1994-01-31  |  1.9 KB  |  106 lines

  1. /*
  2. ** F0.adpro
  3. **
  4. ** $VER: F0.adpro 1.2.0 (16.11.93)
  5. ** 
  6. ** This ARexx program can be used to get around the limit of only being
  7. ** able to launch 100 pre-defined ARexx programs from ADPro/MorphPlus.
  8. **
  9. ** This script requires ADPro v2.5.0 (or higher).
  10. **
  11. ** Copyright © 1990-1993 ASDG, Incorporated
  12. ** All Rights Reserved
  13. */
  14.  
  15.  
  16. ADDRESS "ADPro"
  17. OPTIONS RESULTS
  18.  
  19. NL = '0A'X
  20. SQ = '27'X
  21. DQ = '22'X
  22. TRUE  = 1
  23. FALSE = 0
  24. TempDefaults = "T:TempADProDefaults"
  25.  
  26.  
  27. /*
  28. ** Save the current environment.
  29. */
  30.  
  31. SAVE_DEFAULTS TempDefaults
  32.  
  33.  
  34. /*
  35. ** Specify the location of the RX program.
  36. */
  37.  
  38. RXFile = GETCLIP( "RXFile" )
  39. IF (RXFile = "") THEN DO
  40.     continue = FALSE
  41.     DO UNTIL (continue = TRUE)
  42.         CALL "FREDSCRIPTS:FREDFunctions/GetAFile" '"Enter Location of RC"' '"SYS:REXXC"' '"RX"' FALSE
  43.         RXFile = RESULT
  44.         IF (RXFile = DQ||DQ) THEN
  45.             CALL ErrorOut 10
  46.  
  47.         IF (EXISTS( RXFile )) THEN
  48.             continue = TRUE
  49.         ELSE DO
  50.             ADPRO_TO_FRONT
  51.  
  52.             OKAYN '"F0"' '"RX doesn''t exist in specified directory"' '"Retry|Cancel"'
  53.             IF (RC = 0) THEN
  54.                 CALL ErrorOut 10
  55.         END
  56.     END
  57.  
  58.     SETCLIP( "RXFile", RXFile )
  59. END
  60.  
  61.  
  62. /*
  63. ** Specify the directory where the scripts are located.
  64. */
  65.  
  66. REXXDir = GETCLIP( "REXXDir" )
  67. IF (REXXDir = "") THEN DO
  68.     CALL "FREDSCRIPTS:FREDFunctions/GetADir" '"Enter REXX: Directory"' '"REXX:"' TRUE
  69.     REXXDir = RESULT
  70.     IF (REXXDir = DQ||DQ) THEN
  71.         CALL ErrorOut 10
  72.  
  73.     SETCLIP( "REXXDir", REXXDir )
  74. END
  75.  
  76.  
  77. /*
  78. ** Specify the Rexx script to execute.
  79. */
  80.  
  81. CALL "FREDSCRIPTS:FREDFunctions/GetAFile" '"Enter Rexx Program To Execute"' '"'REXXDir'"' '""""' TRUE
  82. Filename = RESULT
  83. IF (Filename = DQ||DQ) THEN
  84.     CALL ErrorOut 10
  85.  
  86.  
  87. ADDRESS "COMMAND" RXFile Filename
  88.  
  89. CALL ErrorOut 0
  90.  
  91.  
  92. ErrorOut:
  93.     PARSE ARG ExitCode
  94.  
  95.     IF (EXISTS( TempDefaults )) THEN DO
  96.         LOAD_DEFAULTS TempDefaults
  97.         IF (RC ~= 0) THEN DO
  98.             ADPRO_TO_FRONT
  99.             OKAY1 "Error restoring settings."
  100.         END
  101.  
  102.         ADDRESS COMMAND "Delete >NIL:" TempDefaults
  103.     END
  104.  
  105.     EXIT ExitCode
  106.