/* Now calculate the total width of the animation */
totalwidth=brush.width*(endnumber-startnumber+1)
/* Sanity check */
IF totalwidth<1 THEN
NOTIFY("The last file must have a greater|number than the first one.")
/* Generate a new project with the right size */
NEW WIDTH totalwidth HEIGHT brush.height NAME "TransferAnim"
/* Main loop */
DO i=0 TO (endnumber-startnumber)
/* calculate the current file for this cycle */
currfile=stemname || Right(i+startnumber, 4, 0)
/* attempt to load it */
LOADBRUSH currfile
/* Check existence of each file */
IF RC~=0 THEN
CALL NOTIFY("File" currfile "could not be found.|Please make sure all files between|" firstfile "and" lastfile "exist.")
/* Make position caculation as easy as possible */
CHANGEBRUSH HANDLE TOPLEFT
/* Finally put the image on the page */
PLOT i*brush.width 0 PT PEN MODE MATTE STR 100
END
/* Give the user the chance to save his creation right away */
REQUESTRESPONSE VAR choice TITLE '"User Query"' PROMPT '"Do you want to save this animation?"' OPTIONS "Yes|No|Don't Know"
/* Save-file feat. full(?) sanity-check */
IF choice=0 THEN DO
REQUESTFILE VAR saveanim TITLE '"Save Animation"' FILE "TransferAnim"
SAVE
IF RC~=0 THEN
CALL NOTIFY("You cancelled the saving process.")
SAVEPIC NAME saveanim PLUGIN IFF-ILBM
IF RC~=0 THEN
CALL NOTIFY("File" savenanim "could not be saved.")
END
/* Notify user that he can save the file at a later time */
ELSE REQUESTNOTIFY TITLE "Message" OK '"I see"' PROMPT "You can still save the|animation manually."
/* return control to user */
UNLOCKGUI
EXIT
/* Error notification - saves a few lines of rexx code */
NOTIFY:
/* Get the actual error */
PARSE ARG Errorstring
/* Notify user via the ArtEffect-provided requester */
REQUESTNOTIFY TITLE "Error" PROMPT Errorstring
/* always make sure the GUI is unlocked after errors */
UNLOCKGUI
EXIT
RETURN
/* Handling of errors that are not intercepted by the script itself
The most common situation for this message to appear is that the
user did not follow the naming conventions for the frames.
This error will of course also occur when trying to load files of
the wrong format - ASCII, binaries, etc. ;-) */
ERROR:
REQUESTNOTIFY TITLE "ARexx-Error" PROMPT "ARexx-error no." RC "has occured in line" SIGL ".|Please make sure the pictures are properly named|and numbered."