Wait() action

Overview
The Wait action pauses a script until a specified condition has been met.

Parameters
The overall format of Wait parameters is:
 * [timeout-seconds,]condition


 * timeout-seconds
 * The amount of time to wait, in seconds. The value can include a decimal fraction.


 * condition
 * The condition to wait for.

Conditions

 * 3270mode
 * Wait until the emulator is in 3270 mode.


 * disconnect
 * Wait until the host session disconnects.


 * inputfield
 * Wait until the host creates at least one modifiable field on the screen.


 * nvtmode
 * Wait until the emulator is in NVT mode.


 * output
 * Wait until the host modifies the screen. See Output synchronization, below, for details.


 * seconds
 * Wait for the specified timeout.


 * unlock
 * Wait until the host unlocks the keyboard.

Output synchronization
The Wait(Ouptut) action synchronizes with the screen-reading actions. The full definition of Wait(Output) is to wait for the host to modify the screen since the last invocation of a screen-reading action. This can be used by a script to minimize the need to poll the screen for changes. For example, if the host periodically updates the screen with new information, the script can just call Wait(Output), then use a screen-reading action to get the new data.

Note that if the host disconnects while Wait(Output) is pending, Wait(Output) will return, but it will not fail. This gives a script a chance to call a screen-reading action to read whatever might have changed on the screen while the host was disconnecting. A subsequent call to Wait(Output) will fail, because there is no host session and no pending data. This makes looping through host output very simple. Here is a pseudo-code example that is guaranteed to capture all of the host data and exit when the session disconnects:

while (Wait(Output)) { Ascii }

Examples
Wait for half a second. Wait(0.5,Seconds) Wait for the host to update the screen, or for 10 seconds to elapse. Wait(10,Output) Wait for the emulator to enter 3270 mode. Wait(3270Mode)