home *** CD-ROM | disk | FTP | other *** search
- /*
- ** CheckForRawImageData
- **
- ** $VER: CheckForRawImageData 1.0.0 (23.10.93)
- **
- ** This ARexx script contains a function which checks for the existence
- ** of raw image data within ADPro's or MorphPlus' primary image buffer.
- ** If rendered image data exists, an attempt will be made to create raw
- ** data from it.
- **
- ** INPUTS
- ** None
- **
- ** RETURNS
- ** returnCode -- 0 if raw image data exists, 10 otherwise.
- **
- ** This script requires at least ADPro v2.5.0.
- **
- ** Copyright © 1993 ASDG, Incorporated
- ** All Rights Reserved
- */
-
-
- ADDRESS "ADPro"
- OPTIONS RESULTS
-
- PARSE ARG Complain
-
- NL = '0A'X
- SQ = '27'X
- DQ = '22'X
- TRUE = 1
- FALSE = 0
-
-
- /*
- ** Check for the existence of image data.
- */
-
- returnCode = 0
-
- IMAGE_TYPE
- ImageType = ADPRO_RESULT
- IF (WORD( ImageType, 1 ) = "NONE") THEN DO
- IF (Complain = TRUE) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "There is currently no image" || NL ||,
- "in ADPro's image buffer. An image" || NL ||,
- "is required for this operation."
- SCREEN_TO_FRONT "FRED"
- END
-
- returnCode = 10
- END
- ELSE DO
- IF (WORD( ImageType, 1 ) = "BITPLANE") THEN DO
- /*
- ** There's no raw data, but there is rendered data.
- ** The user must want us to modify the rendered data.
- */
-
- OPERATOR "RENDERED_TO_RAW"
- IF (RC ~= 0) THEN DO
- IF (Complain = TRUE) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Converting rendered to raw failed."
- SCREEN_TO_FRONT "FRED"
- END
-
- returnCode = 10
- END
- END
- END
-
- RETURN returnCode
-