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

  1. /* This creates a Main Window (with RESULT Flag) with a Group of TEXT.
  2.    Whenever the user moves the window, and presses ENTER, we use RXSET to
  3.    force the window position to 0 ,0
  4. */
  5.  
  6. /* Trap ERROR and FAILURE */
  7. SIGNAL ON ERROR
  8. SIGNAL ON FAILURE
  9.  
  10. /* =============== Create "Main Window" ================= */
  11. /* First Group is TEXT */
  12. RXTYPE.1 = 'TEXT'
  13.  
  14. /* Use of a control in this group causes RXDLG to return */
  15. RXFLAGS.1 = 'CENTER'
  16.  
  17. /* Phrases. No Groupbox */
  18. RXLABEL.1 = 'This is an example of RXSET with a WindowOperation of MOVE.|Move the window and press ENTER.|Window will be forced to the lower left corner of Desktop.'
  19.  
  20. /* TotalPhrases, PhrasesPerLine, WidthOfPhrase, BetweenPhrases */
  21. RXINFO.1 = '3 1 0 0'
  22.  
  23. /* Position */
  24. RXX.1 = 10
  25. RXY.1 = 10
  26.  
  27. /* Default size and position (also gives us sizing and max button) */
  28. RXWIN1 = ''
  29.  
  30. /* NOCLOSE since we want to close the window ourselves */
  31. RXDLG 1 '"Main Window"' 'RXWIN1'  'NOCLOSE|RESULT'
  32.  
  33. more:
  34.  
  35. /* Do user interaction */
  36. RXDLG
  37.  
  38. /* Did user click upon the CLOSE ICON? If so, then exit */
  39. IF RXID < 0 THEN EXIT
  40.  
  41. /* The only other thing that could have caused RXDLG to return is ENTER.
  42.    Note that we haven't setup a timeout, nor set the KEYS flag
  43.    of any window, and have no Groups with END Flag set. So... */
  44.  
  45. /* Force Main Window position to 0, 0 */
  46. RXSET '""' 'MOVE' 0 0
  47.  
  48. SIGNAL more
  49.  
  50. /* ==================================================== */
  51. FAILURE:
  52.     /* NOTE: the variable RC contains the returned error message (not a number,
  53.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  54.     Because we used the default severity level, Rexx Dialog has already displayed
  55.     this error message to the enduser */
  56.     EXIT
  57. ERROR:
  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.