waitln

Waits a line that contains string.

waitln <string1> [<string2> ...]

Remarks

Pauses until a line which contains one of the character strings is received from the host, or until the timeout occurs. Maximum number of the strings is 10.

When the empty string is specified, this command will wait an character + CRLF.

If the system variable "timeout" or "mtimeout" is greater than zero, the timeout occurs when <timeout>.<mtimeout> seconds have passed. If the timeout is less than or equal to zero, the timeout never occurs.

These commands return the received line in the system variable "inputstr" and one of the following values in the system variable "result":

Value Meaning
0 Timeout.
1 A line which contains <string1> has received.
2 A line which contains <string2> has received.
n A line which contains <stringn> has received. n=1..10.

Example

waitln 'cal'
messagebox inputstr "str"  ; echo aaa cal hoge fuga

See also