home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / ADPro251-3.DMS / ADPro251-3.adf / FREDScripts.lha / FREDFunctions / CheckForRenderedImageData < prev    next >
Encoding:
Text File  |  1994-01-31  |  1.3 KB  |  68 lines

  1. /*
  2. ** CheckForRenderedImageData
  3. **
  4. ** $VER: CheckForRenderedImageData 1.0.0 (24.10.93)
  5. **
  6. ** This ARexx script contains a function which checks for the existence
  7. ** of raw image data within ADPro's or MorphPlus' primary image buffer.
  8. ** If rendered image data exists, an attempt will be made to create raw
  9. ** data from it.
  10. **
  11. ** INPUTS
  12. **    None
  13. **
  14. ** RETURNS
  15. **    returnCode -- 0 if raw image data exists, 10 otherwise.
  16. **
  17. ** This script requires at least ADPro v2.5.0.
  18. **
  19. ** Copyright © 1993 ASDG, Incorporated
  20. ** All Rights Reserved
  21. */
  22.  
  23.  
  24. ADDRESS "ADPro"
  25. OPTIONS RESULTS
  26.  
  27. PARSE ARG Complain
  28.  
  29. NL = '0A'X
  30. SQ = '27'X
  31. DQ = '22'X
  32. TRUE = 1
  33. FALSE = 0
  34.  
  35.  
  36. /*
  37. ** Check for the existence of image data.
  38. */
  39.  
  40. returnCode = 0
  41.  
  42. IMAGE_TYPE
  43. ImageType = ADPRO_RESULT
  44. IF (WORD( ImageType, 1 ) = "NONE") THEN DO
  45.     IF (Complain = TRUE) THEN DO
  46.         ADPRO_TO_FRONT
  47.         OKAY1 "There is currently no image" || NL ||,
  48.             "in ADPro's image buffer.  An image" || NL ||,
  49.             "is required for this operation."
  50.         SCREEN_TO_FRONT "FRED"
  51.     END
  52.  
  53.     returnCode = 10
  54. END
  55. ELSE IF (WORD( ImageType, 1 ) ~= "BITPLANE") & (WORD( ImageType, 2 ) ~= "BITPLANE") THEN DO
  56.     IF (Complain = TRUE) THEN DO
  57.         ADPRO_TO_FRONT
  58.         OKAY1 "There is currently no rendered" || NL ||,
  59.             "data in ADPro's buffer.  Rendered" || NL ||,
  60.             "data is required for this operation."
  61.         SCREEN_TO_FRONT "FRED"
  62.     END
  63.  
  64.     returnCode = 10
  65. END
  66.  
  67. RETURN returnCode
  68.