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

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