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

  1. /* An example of RXFILE */
  2.  
  3. /* Trap ERROR and FAILURE */
  4. SIGNAL ON ERROR
  5. SIGNAL ON FAILURE
  6.  
  7.  
  8. /* ====================== 'Main Window' ======================= */
  9. /* Just put a TEXT Group in the window in order to have something */
  10. RXTYPE.1 = 'TEXT'
  11.  
  12. /* Default */
  13. RXFLAGS.1 = ' '
  14.  
  15. /* Text lines */
  16. RXLABEL.1 = 'Example of RXFILE.'
  17.  
  18. /* TotalPhrases, PhrasesPerLine, WidthOfPhrase, BetweenPhrases */
  19. RXINFO.1 = '1 1 0 0'
  20.  
  21. /* Position */
  22. RXX.1 = 10
  23. RXY.1 = 10
  24.  
  25. /* Default size and position (also gives us sizing and max button) */
  26. RXWINMAIN = ' '
  27. RXDLG 1 '"Main Window"' 'RXWINMAIN'
  28.  
  29. /* NOTE: We don't actually need a main window open in order to present
  30.    a File Dialog. If you comment out the RXDLG call above, then the File
  31.    Dialog will open on the Desktop. Note that opening it in the Main Window
  32.    automatically causes a MODAL condition, so even if we were within a
  33.    Loop Design script, the RXFILE call will not return until the File Dialog
  34.    is dismissed
  35. */
  36.  
  37. /* Store the filename in the variable FN. Initialize it to '*.cmd' in order to
  38.    initially display all filenames in the current directory that end in
  39.    '.cmd' */
  40. FN = 'C:\testrexx\*.cmd'
  41.  
  42. /* Do the dialog */
  43. RXFILE 'LOAD' 'FN' 'Load Me|' 'This is the title'
  44.  
  45. /* Check for OK */
  46. IF RC = '' THEN RXSAY FN
  47.  
  48. /* RC must be 'Cancel', because all other errors jumped to ERROR */
  49. ELSE RXSAY 'User cancelled!'
  50.  
  51. /* ========================== Done ========================== */
  52. EXIT
  53.  
  54. FAILURE:
  55.     /* NOTE: the variable RC contains the returned error message (not a number,
  56.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  57.     Because we used the default severity level, Rexx Dialog has already displayed
  58.     this error message to the enduser */
  59.     EXIT
  60. ERROR:
  61.     /* NOTE: the variable RC contains the returned error message (not a number,
  62.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  63.     Because we used the default severity level, Rexx Dialog has already displayed
  64.     this error message to the enduser */
  65.     EXIT
  66.