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