home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / Painting / HF-DS2.DMS / in.adf / DSdir1.lha / Rexx / Star8.dsrx < prev    next >
Encoding:
Text File  |  1996-10-29  |  2.5 KB  |  112 lines

  1. /* Allow commands to return results */
  2.  
  3. options results
  4.  
  5. /* On error, goto ERROR:. Comment out this line if you wish to */
  6. /* perform your own error checking. */
  7.  
  8. signal on error
  9.  
  10. 'PROJECT_LOCK'
  11.  
  12. /* BEGIN PROGRAM *************************************************/
  13.  
  14. /*
  15. PROGRAM:     Star8.dsdr
  16. DESCRIPTION:     Draws a 8 pointed star and places it into the clipboard.
  17.         You may then place the star by dragging it
  18.         onto the page.
  19. DATE:        29/10/96
  20. AUTHOR:        Andy Dean
  21. */
  22.  
  23. REDRAW_OFF
  24.  
  25. CREATE_BEZIER CLOSED '1.0in' '0.5in' L,
  26.     '0.6848in' '0.4235in' L,
  27.     '0.8536in' '0.1464in' L,
  28.     '0.5765in' '0.3152in' L,
  29.     '0.5in' '0.0in' L,
  30.     '0.4235in' '0.3152in' L,
  31.     '0.1464in' '0.1464in' L,
  32.     '0.3152in' '0.4235in' L,
  33.     '0.0in' '0.5in' L,
  34.     '0.3152in' '0.5765in' L,
  35.     '0.1464in' '0.8536in' L,
  36.     '0.4235in' '0.6848in' L,
  37.     '0.5in' '1.0in' L,
  38.     '0.5765in' '0.6848in' L,
  39.     '0.8536in' '0.8536in' L,
  40.     '0.6848in' '0.5765in'
  41.     
  42. CUT
  43.  
  44. REDRAW_ON
  45.  
  46. PASTE
  47.  
  48. /* END PROGRAM ***************************************************/
  49.  
  50. 'PROJECT_UNLOCK'
  51.  
  52. exit
  53.  
  54. /* On ERROR */
  55.  
  56. ERROR:
  57.  
  58. 'PROJECT_UNLOCK'
  59.  
  60. /* If we get here, either an error occurred with the command's */
  61. /* execution or there was an error with the command itself. */
  62. /* In the former case, rc2 contains the error message and in */
  63. /* the latter, rc2 contains an error number. SIGL contains */
  64. /* the line number of the command which caused the jump */
  65. /* to ERROR: */
  66.  
  67. if datatype(rc2,'NUMERIC') == 1 then do
  68.     /* See if we can describe the error with a string */
  69.  
  70.     select
  71.         when rc2 == 103 then
  72.             err_string = "ERROR 103, "||,
  73.                 "out of memory at line "||SIGL
  74.         when rc2 == 114 then
  75.             err_string = "ERROR 114, "||,
  76.                 "bad command template at line "||SIGL
  77.         when rc2 == 115 then
  78.             err_string = "ERROR 115, "||,
  79.                 "bad number for /N argument at line "||SIGL
  80.         when rc2 == 116 then
  81.             err_string = "ERROR 116, "||,
  82.                 "required argument missing at line "||SIGL
  83.         when rc2 == 117 then
  84.             err_string = "ERROR 117, "||,
  85.                 "value after keywork missing at line "||SIGL
  86.         when rc2 == 118 then
  87.             err_string = "ERROR 118, "||,
  88.                 "wrong number of arguments at line "||SIGL
  89.         when rc2 == 119 then
  90.             err_string = "ERROR 119, "||,
  91.                 "unmatched quotes at line "||SIGL
  92.         when rc2 == 120 then
  93.             err_string = "ERROR 120, "||,
  94.                 "line too long at line "||SIGL
  95.         when rc2 == 236 then
  96.             err_string = "ERROR 236, "||,
  97.                 "unknown command at line "||SIGL
  98.         otherwise
  99.             err_string = "ERROR "||rc2||", at line "||SIGL
  100.         end
  101.     end
  102. else if rc2 == 'RC2' then do
  103.     err_string = "ERROR in command at line "||SIGL
  104.     end
  105. else do
  106.     err_string = rc2||", line "||SIGL
  107.     end
  108.  
  109. req_message TEXT '"'err_string'"'
  110.  
  111. exit
  112.