home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxdlg11.zip / rexxset8.cmd < prev    next >
OS/2 REXX Batch file  |  1995-03-01  |  2KB  |  68 lines

  1. /* This creates a Main Window with a Group of 1 SPIN with the
  2.    END flag set.  Whenever the user changes the SPIN's value, RXDLG
  3.    returns, and we size the spin's width to the value typed into the
  4.    spin.
  5. */
  6.  
  7. /* Trap ERROR and FAILURE */
  8. SIGNAL ON ERROR
  9. SIGNAL ON FAILURE
  10.  
  11. /* =============== Create "Main Window" ================= */
  12. /* First Group is SPIN */
  13. RXTYPE.1 = 'SPIN'
  14.  
  15. /* Use of a control in this group causes RXDLG to return */
  16. RXFLAGS.1 = 'END|VALUE'
  17.  
  18. /* Label for control */
  19. RXLABEL.1 = '200 40 Width:|Spin'
  20.  
  21. /* TotalControls, ControlsPerLine, WidthOfControls */
  22. RXINFO.1 = '1 1 70'
  23.  
  24. /* initial value of spin */
  25. RXVAL.1 = '64'
  26.  
  27. /* Position */
  28. RXX.1 = 70
  29. RXY.1 = 20
  30.  
  31. /* Default size and position (also gives us sizing and max button) */
  32. RXWIN1 = ''
  33.  
  34. /* NOCLOSE since we want to close the window ourselves.
  35.     No RESULT Flag, so the ESC and ENTER keys do nothing, and we don't
  36.     have to bother checking for those */
  37. RXDLG 1 '"Main Window"' 'RXWIN1'  'NOCLOSE'
  38.  
  39. more:
  40.  
  41. /* Do user interaction */
  42. RXDLG
  43.  
  44. /* Did user click upon the CLOSE ICON? If so, then exit */
  45. IF RXID < 0 THEN EXIT
  46.  
  47. /* Since there is only 1 group and 1 control, we know that it caused RXDLG
  48.     to return. Set spin width to value typed into the spin. We don't care
  49.     about changing the height, so omit that.
  50. */
  51.  
  52. RXSET '""' 1 0 'SIZE' RXVAL.1
  53. SIGNAL more
  54.  
  55. /* ==================================================== */
  56. FAILURE:
  57.     /* NOTE: the variable RC contains the returned error message (not a number,
  58.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  59.     Because we used the default severity level, Rexx Dialog has already displayed
  60.     this error message to the enduser */
  61.     EXIT
  62. ERROR:
  63.     /* NOTE: the variable RC contains the returned error message (not a number,
  64.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  65.     Because we used the default severity level, Rexx Dialog has already displayed
  66.     this error message to the enduser */
  67.     EXIT
  68.