Script WAIT Statement

WAIT [ _var1] [LNUM _var2] for-list

The WAIT statement is used to pause script processing until a specific response is received from the online host. This statement results in data being read from the incoming communication port one line at a time. A line includes everything up to a carriage return.

After WAIT is executed, _var1 contains the last line received from the host.

LNUM _var2 puts an L-number into the variable _var2.

for-list is one or more:

FOR for-condition [THEN] block

This is defined as: "If for-condition is met, then execute these statements."

The block is optional, except for the last for-condition. Often the block contains a CONTINUE statement.

For-condition is either:

"string" (substring received from host)

or:

n [SECOND[S]] (passing of time, n, can be an integer or a variable)

If n is zero, the WAIT is forever.

See the example at the TRYAGAIN statement.

Copyright © 2017 American Chemical Society. All Rights Reserved.