home *** CD-ROM | disk | FTP | other *** search
/ drawSTUDIO / drawSTUDIO.iso / english / drawstudiofpu / rexx / pentagon.dsrx < prev    next >
Encoding:
Text File  |  1996-10-29  |  2.3 KB  |  101 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:     Pentagon.dsdr
  16. DESCRIPTION:     Draws a pentagon and places it into the clipboard.
  17.         You may then place the pentagon 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 '0.9755in' '0.3455in' L,
  26.     '0.5in' '0.0in' L '0.0245in' '0.3455in' L,
  27.     '0.2061in' '0.9045in' L '0.7939in' '0.9045in'
  28.  
  29. CUT
  30.  
  31. REDRAW_ON
  32.  
  33. PASTE
  34.  
  35.  
  36.  
  37. /* END PROGRAM ***************************************************/
  38.  
  39. 'PROJECT_UNLOCK'
  40.  
  41. exit
  42.  
  43. /* On ERROR */
  44.  
  45. ERROR:
  46.  
  47. 'PROJECT_UNLOCK'
  48.  
  49. /* If we get here, either an error occurred with the command's */
  50. /* execution or there was an error with the command itself. */
  51. /* In the former case, rc2 contains the error message and in */
  52. /* the latter, rc2 contains an error number. SIGL contains */
  53. /* the line number of the command which caused the jump */
  54. /* to ERROR: */
  55.  
  56. if datatype(rc2,'NUMERIC') == 1 then do
  57.     /* See if we can describe the error with a string */
  58.  
  59.     select
  60.         when rc2 == 103 then
  61.             err_string = "ERROR 103, "||,
  62.                 "out of memory at line "||SIGL
  63.         when rc2 == 114 then
  64.             err_string = "ERROR 114, "||,
  65.                 "bad command template at line "||SIGL
  66.         when rc2 == 115 then
  67.             err_string = "ERROR 115, "||,
  68.                 "bad number for /N argument at line "||SIGL
  69.         when rc2 == 116 then
  70.             err_string = "ERROR 116, "||,
  71.                 "required argument missing at line "||SIGL
  72.         when rc2 == 117 then
  73.             err_string = "ERROR 117, "||,
  74.                 "value after keywork missing at line "||SIGL
  75.         when rc2 == 118 then
  76.             err_string = "ERROR 118, "||,
  77.                 "wrong number of arguments at line "||SIGL
  78.         when rc2 == 119 then
  79.             err_string = "ERROR 119, "||,
  80.                 "unmatched quotes at line "||SIGL
  81.         when rc2 == 120 then
  82.             err_string = "ERROR 120, "||,
  83.                 "line too long at line "||SIGL
  84.         when rc2 == 236 then
  85.             err_string = "ERROR 236, "||,
  86.                 "unknown command at line "||SIGL
  87.         otherwise
  88.             err_string = "ERROR "||rc2||", at line "||SIGL
  89.         end
  90.     end
  91. else if rc2 == 'RC2' then do
  92.     err_string = "ERROR in command at line "||SIGL
  93.     end
  94. else do
  95.     err_string = rc2||", line "||SIGL
  96.     end
  97.  
  98. req_message TEXT '"'err_string'"'
  99.  
  100. exit
  101.