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

  1. /* A test script for RX3.EXE */
  2.  
  3. /* Trap ERROR and FAILURE */
  4. SIGNAL ON ERROR
  5. SIGNAL ON FAILURE
  6.  
  7.  
  8. /* ====================== 'Main Window' ======================= */
  9. /* First Group is TEXT */
  10. RXTYPE.1 = 'TEXT'
  11.  
  12. /* Default */
  13. RXFLAGS.1 = ' '
  14.  
  15. /* Text lines */
  16. RXLABEL.1 = "|"
  17.  
  18. /* TotalPhrases, PhrasesPerLine, WidthOfPhrase, BetweenPhrases */
  19. RXINFO.1 = '2 1 140 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' 'RESULT'
  28.  
  29.  
  30.  
  31. /* Set display to DISPLAYLEVEL so that we see the auto
  32.    message display of APPSUBTRACT's error message */
  33. RXERR 50
  34.  
  35.  
  36. /* ============== Call APPADD ============ */
  37. APPADD 5 384
  38.  
  39. /* Print result */
  40. RXSET '""' 1 1 'VAL' 'APPADD:' Sum
  41.  
  42.  
  43.  
  44. /* ============== Call APPSUBTRACT ============ */
  45. APPSUBTRACT 384 5
  46.  
  47. /* Print result */
  48. RXSET '""' 1 2 'VAL' 'APPSUBTRACT:' Answer.0
  49.  
  50.  
  51.  
  52. more:
  53.    /* Do user interaction */
  54.    RXDLG
  55.  
  56.    /* Did user press ESC or click on the CLOSE ICON? */
  57.    IF RXID < 0 THEN EXIT
  58.  
  59.    /* Must have pressed ENTER. Do APPSUBTRACT, but this time
  60.        pass bad args. This results in a FAILURE */
  61.    APPSUBTRACT 5 384
  62.  
  63.    /* Print result */
  64.    RXSET '""' 1 2 'VAL' 'APPSUBTRACT:' Answer.0
  65.  
  66. /* Do another message loop */
  67. SIGNAL more
  68.  
  69.  
  70.  
  71. /* ==================================================== */
  72.  
  73. FAILURE:
  74.     /* NOTE: the variable RC contains the returned error message (not a number,
  75.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  76.     Because we used the default severity level, Rexx Dialog has already displayed
  77.     this error message to the enduser */
  78.     EXIT
  79. ERROR:
  80.     /* NOTE: the variable RC contains the returned error message (not a number,
  81.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  82.     Because we used the default severity level, Rexx Dialog has already displayed
  83.     this error message to the enduser */
  84.     EXIT
  85.