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

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