home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxhll.zip / MODEM.REX < prev    next >
OS/2 REXX Batch file  |  1993-11-19  |  569b  |  23 lines

  1. /* #include <modem.rex> */
  2.  
  3.  
  4. ModemWaitFor: procedure
  5.    /**
  6.    ***  This will wait for a particular string for a particular time.
  7.    ***  The code will block on an input character, so it is possible for
  8.    ***  this code to hang completely.  There is no non-blocking read
  9.    ***  in REXX with which to implement a timeout.
  10.    **/
  11.  
  12.    parse arg ComPort,Wait,String
  13.  
  14.    call time('Reset')
  15.  
  16.    InBound = ""
  17.    do while pos(String,InBound) == 0
  18.      InBound = InBound||CHARIN(ComPort)
  19.      if time('E') > Wait then
  20.         return 4
  21.    end
  22.    return 1
  23.