home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 January / CHIPCD1_98.iso / software / tipsy / zoc / install.fil / SCRIPT / RXSAMPLE / MANUAL / IF3.ZRX < prev    next >
Text File  |  1996-08-26  |  800b  |  31 lines

  1. /* REXX sample about decisions */
  2.  
  3. /* Set max wait time to 60 seconds */
  4. CALL ZocTimeout 60
  5.  
  6. /* Wait for 'Name?' - check for success and report error */
  7. timeout= ZocWait("Name?")
  8. IF timeout=0 THEN DO /* outer IF */
  9.    /* received 'Name?' */
  10.    CALL ZocSend "Joe User^M"
  11.  
  12.    /* Wait for 'Password?' - check for success and report error */
  13.    timeout= ZocWait("Password?")
  14.    IF timeout=0 THEN DO
  15.       /* received 'Password?' */
  16.       CALL ZocSend "secret^M"
  17.    END
  18.    ELSE DO /* inner IF */
  19.       /* Ouch, 'Password?' was not received */
  20.       CALL ZocWriteln "ERROR (Password)!!"
  21.       CALL ZocHangup
  22.    END /* inner IF */
  23. END
  24. ELSE DO /* outer IF */
  25.    /* Ouch, 'Name?' was not received */
  26.    CALL ZocWriteln "ERROR (Name)!!"
  27.    CALL ZocHangup
  28. END /* outer IF */
  29.  
  30. EXIT
  31.