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

  1. /*
  2. ** Splitz.adpro
  3. **
  4. ** $VER: Splitz.adpro 1.0.0 (16.11.93)
  5. **
  6. ** This ARexx program will use the Amiga Splitz program
  7. ** to split any file into smaller chunks.  This is useful
  8. ** for transporting an image that is too large to fit on
  9. ** a single floppy disk.
  10. **
  11. ** This program requires ADPro v2.5.0 (or higher) and the Amiga
  12. ** Splitz program.
  13. **
  14. ** Copyright © 1993 ASDG, Incorporated
  15. ** All Rights Reserved
  16. */
  17.  
  18.  
  19. ADDRESS "ADPro"
  20. OPTIONS RESULTS
  21.  
  22. NL = '0A'X
  23. SQ = '27'X
  24. DQ = '22'X
  25. TRUE  = 1
  26. FALSE = 0
  27. TempDefaults = "T:TempADProDefaults"
  28.  
  29.  
  30. /*
  31. ** Save the current environment.
  32. */
  33.  
  34. SAVE_DEFAULTS TempDefaults
  35.  
  36.  
  37. /*
  38. ** Specify the location of the Splitz program.
  39. */
  40.  
  41. SplitzFile = GETCLIP( "SplitzFile" )
  42. IF (SplitzFile = "") THEN DO
  43.     continue = FALSE
  44.     DO UNTIL (continue = TRUE)
  45.         CALL "FREDSCRIPTS:FREDFunctions/GetAFile" '"Enter Location of Splitz"' '"ADPRO:"' '"Splitz"' FALSE
  46.         SplitzFile = RESULT
  47.         IF (SplitzFile = DQ||DQ) THEN
  48.             CALL ErrorOut 10
  49.  
  50.         IF (EXISTS( SplitzFile )) THEN
  51.             continue = TRUE
  52.         ELSE DO
  53.             ADPRO_TO_FRONT
  54.  
  55.             OKAYN '"Splitz"' '"Splitz doesn''t exist in specified directory"' '"Retry|Cancel"'
  56.             IF (RC = 0) THEN
  57.                 CALL ErrorOut 10
  58.         END
  59.     END
  60.  
  61.     SETCLIP( "SplitzFile", SplitzFile )
  62. END
  63.  
  64.  
  65. /*
  66. ** Select the image or file to split up
  67. */
  68.  
  69. CALL "FREDSCRIPTS:FREDFunctions/GetAFile" '"Select image (or file) to split"' '"ADPRO:"' TRUE
  70. filename = RESULT
  71. IF (filename = DQ||DQ) THEN DO  
  72.     ADPRO_TO_FRONT
  73.     OKAY1 "No filename specified."
  74.     CALL ErrorOut 10
  75. END
  76.  
  77.  
  78. /*
  79. ** Get the path and name of the destination chunks to save.
  80. */
  81.  
  82. CALL "FREDSCRIPTS:FREDFunctions/GetAFile" '"Place & name destination chunks."' '"ADPRO:"' TRUE
  83. chunkname = RESULT
  84. IF (chunkname = DQ||DQ) THEN DO
  85.     ADPRO_TO_FRONT
  86.     OKAY1 "Destination chunks not specified."
  87.     CALL ErrorOut 10
  88. END
  89.  
  90.  
  91. /*
  92. ** Get the chunksize
  93. */
  94.  
  95. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Enter chunk size in bytes."' 720000 240 1073741824 TRUE
  96. chunksize = RESULT
  97. IF (chunksize = (240-1)) THEN DO
  98.     ADPRO_TO_FRONT
  99.     OKAY1 "Chunk size was not entered."
  100.     CALL ErrorOut 10
  101. END
  102.  
  103.  
  104. /*
  105. ** Slice & dice
  106. */
  107.  
  108. ADDRESS COMMAND SplitzFile filename chunkname chunksize
  109. IF (RC ~= 0) THEN DO
  110.     ADPRO_TO_FRONT
  111.     OKAY1 "Could not load Splitz."
  112.     CALL ErrorOut 10
  113. END
  114.  
  115. ADPRO_TO_FRONT
  116. OKAY1 "File has been split."
  117.  
  118. CALL ErrorOut 0
  119.  
  120.  
  121. ErrorOut:
  122.     PARSE ARG ExitCode
  123.  
  124.     IF (EXISTS( TempDefaults )) THEN DO
  125.         LOAD_DEFAULTS TempDefaults
  126.         IF (RC ~= 0) THEN DO
  127.             ADPRO_TO_FRONT
  128.             OKAY1 "Error restoring settings."
  129.         END
  130.  
  131.         ADDRESS COMMAND "Delete >NIL:" TempDefaults
  132.     END
  133.  
  134.     EXIT ExitCode
  135.