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

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