User guide

7 RASExpress Script Language
CommPlete Communications Server 181
WAITFOR waitfor(string pattern [, integer timeout]) : integer;
Waits for a pattern from the remote machine. Timeout is optional. It waits for pattern
to be received from the remote machine or timeout to occur (if specified), whichever is
earlier. The pattern match is not case sensitive. If the connection is not initialized or
pattern is not received, 0 is returned; otherwise 1 is returned.
Example
/* This script illustrates the waitfor command. */
proc main;
string pat;
integer timeout;
pat = "abcdef";
timeout = 10;
fdisplay("wait for %sstarts (timeout = %d seconds)^J^M",
pat, timeout);
if (waitfor(pat, timeout)) then
display("Pattern got, wait ends^J^M");
else
display("Pattern not got, wait failed^J^M");
endif
endproc