/* ** JoinANIMs.adpro ** ** $VER: JoinANIMs.adpro 1.0.0 (8.1.93) ** ** This AREXX program will take some existing ANIM files and join them ** into one composite ANIM. ** ** Example ARexx program for controlling MorphPlus/ADPro by ASDG Incorporated. ** ** Copyright © 1990-1992 ASDG Incorporated All Rights Reserved */ ADDRESS "ADPro" OPTIONS RESULTS NL = '0A'X ADPRO_TO_FRONT PSTATUS oldPSTATUS = ADPRO_RESULT PSTATUS "UNLOCKED" GETNUMBER '"How many ANIMs to join?"' 0 0 10 IF ( RC ~= 0 ) THEN DO OKAY1 "Error, no number specified." EXIT 10 END numANIMS = ADPRO_RESULT IF ( numANIMS < 2 ) THEN DO OKAY1 "You must specify at least" || NL ||, "two ANIMs to join." EXIT 10 END num = 1 continue = 0 DO WHILE ( continue = 0 ) string = "Enter ANIM # "num GETFILE '"'string'"' IF (RC ~= 0) THEN DO OKAY1 "Error, no ANIM specified." EXIT 10 END fname.num = ADPRO_RESULT OKAY2 "Was this ANIM created with the" || NL ||, "wrap up option?" || NL ||, "Select Ok if yes" || NL ||, "or Cancel if no." wrap.num = RC num = num + 1 IF ( num > numANIMS ) THEN continue = 1 END GETFILE '"Enter name of destination ANIM."' IF ( RC ~= 0 ) THEN DO OKAY1 "Error, no destination ANIM specified." EXIT 10 END destName = ADPRO_RESULT IF (EXISTS( destName )) THEN DO OKAY2 "Truncate existing anim." || NL ||, "Select Ok for yes" || NL ||, "or Cancel for no." truncDest = RC IF ( truncDest = 1 ) THEN ADDRESS "COMMAND" delete destName END OKAY2 "Should the destination ANIM be" || NL ||, "saved with the wrapup option?" || NL ||, "Select Ok if yes" || NL ||, "or Cancel if no." wrapDest = RC CALL "FREDSCRIPTS:FREDFunctions/GetLoader" "ANIM" IF (RESULT ~= 0) THEN EXIT RESULT CALL "FREDSCRIPTS:FREDFunctions/GetSaver" "ANIM" IF (RESULT ~= 0) THEN EXIT RESULT num = 1 continue = 0 DO WHILE ( continue = 0 ) LOAD fname.num "COUNT" IF ( RC ~= 0 ) THEN DO OKAY1 "Can't find ANIM file." IF ( EXISTS( destName )) THEN SAVE destName "QUIT" EXIT 10 END numframes = ADPRO_RESULT IF ( wrap.num ~= 0 ) THEN numframes = numframes - 2 num2 = 1 continue2 = 0 DO WHILE ( continue2 = 0 ) LOAD fname.num "FRAME" num2 IF ( RC ~= 0 ) THEN DO OKAY1 "Error during load." || NL ||, fname.num || NL ||, "frame # " || num2 IF ( EXISTS( destName )) THEN SAVE destName "QUIT" EXIT 10 END SAVE destName "APPEND" "IMAGE" IF ( RC ~= 0 ) THEN DO OKAY1 "Error writing frame " || num2 || NL ||, "of destination ANIM." SAVE destName "QUIT" "IMAGE" IF ( RC ~= 0 ) THEN OKAY1 "Error closing destination ANIM." EXIT 10 END num2 = num2 + 1 IF ( num2 > numframes ) THEN continue2 = 1 END num = num + 1 IF ( num > numANIMS ) THEN continue = 1 END IF ( wrapDest ~= 0 ) THEN DO SAVE destName "WRAPUP" "IMAGE" IF ( RC ~= 0 ) THEN DO OKAY1 "Error wraping up destination ANIM." EXIT 10 END SAVE destName "QUIT" "IMAGE" IF ( RC ~= 0 ) THEN DO OKAY1 "Error closing up destination ANIM." EXIT 10 END END PSTATUS oldPSTATUS EXIT 0