home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Splitz.adpro
- **
- ** $VER: Splitz.adpro 1.0.0 (16.11.93)
- **
- ** This ARexx program will use the Amiga Splitz program
- ** to split any file into smaller chunks. This is useful
- ** for transporting an image that is too large to fit on
- ** a single floppy disk.
- **
- ** This program requires ADPro v2.5.0 (or higher) and the Amiga
- ** Splitz program.
- **
- ** Copyright © 1993 ASDG, Incorporated
- ** All Rights Reserved
- */
-
-
- ADDRESS "ADPro"
- OPTIONS RESULTS
-
- NL = '0A'X
- SQ = '27'X
- DQ = '22'X
- TRUE = 1
- FALSE = 0
- TempDefaults = "T:TempADProDefaults"
-
-
- /*
- ** Save the current environment.
- */
-
- SAVE_DEFAULTS TempDefaults
-
-
- /*
- ** Specify the location of the Splitz program.
- */
-
- SplitzFile = GETCLIP( "SplitzFile" )
- IF (SplitzFile = "") THEN DO
- continue = FALSE
- DO UNTIL (continue = TRUE)
- CALL "FREDSCRIPTS:FREDFunctions/GetAFile" '"Enter Location of Splitz"' '"ADPRO:"' '"Splitz"' FALSE
- SplitzFile = RESULT
- IF (SplitzFile = DQ||DQ) THEN
- CALL ErrorOut 10
-
- IF (EXISTS( SplitzFile )) THEN
- continue = TRUE
- ELSE DO
- ADPRO_TO_FRONT
-
- OKAYN '"Splitz"' '"Splitz doesn''t exist in specified directory"' '"Retry|Cancel"'
- IF (RC = 0) THEN
- CALL ErrorOut 10
- END
- END
-
- SETCLIP( "SplitzFile", SplitzFile )
- END
-
-
- /*
- ** Select the image or file to split up
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/GetAFile" '"Select image (or file) to split"' '"ADPRO:"' TRUE
- filename = RESULT
- IF (filename = DQ||DQ) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "No filename specified."
- CALL ErrorOut 10
- END
-
-
- /*
- ** Get the path and name of the destination chunks to save.
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/GetAFile" '"Place & name destination chunks."' '"ADPRO:"' TRUE
- chunkname = RESULT
- IF (chunkname = DQ||DQ) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Destination chunks not specified."
- CALL ErrorOut 10
- END
-
-
- /*
- ** Get the chunksize
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Enter chunk size in bytes."' 720000 240 1073741824 TRUE
- chunksize = RESULT
- IF (chunksize = (240-1)) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Chunk size was not entered."
- CALL ErrorOut 10
- END
-
-
- /*
- ** Slice & dice
- */
-
- ADDRESS COMMAND SplitzFile filename chunkname chunksize
- IF (RC ~= 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Could not load Splitz."
- CALL ErrorOut 10
- END
-
- ADPRO_TO_FRONT
- OKAY1 "File has been split."
-
- CALL ErrorOut 0
-
-
- ErrorOut:
- PARSE ARG ExitCode
-
- IF (EXISTS( TempDefaults )) THEN DO
- LOAD_DEFAULTS TempDefaults
- IF (RC ~= 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Error restoring settings."
- END
-
- ADDRESS COMMAND "Delete >NIL:" TempDefaults
- END
-
- EXIT ExitCode
-