Using the WAIT UNTIL and QUIESCE UNTIL statements

The WAIT UNTIL statement and the QUIESCE UNTIL statement (or these clauses on the TRANSMIT statement) stop execution of a terminal's STL program. The terminal then waits or quiesces until the specified conditions are met. When the condition is met, the STL program continues synchronous execution after the intermessage delay has expired.

The WAIT UNTIL and QUIESCE UNTIL statements do not use asynchronous subset statements.

The WAIT UNTIL statement uses the following syntax:
     ┌                                        ┐
WAIT │ UNTIL {ONIN [asynchronous_condition]}  |
     │       {ONOUT [asynchronous_condition]} |
     │       {POSTED(event_name)}             |
     │       {SIGNALED(event_name)}           |
     ⋘                                        ┘ 

The asynchronous_condition can be any condition that meets the requirements described in Setting up asynchronous conditions. The POSTED and SIGNALED functions enable you to test whether an event to be posted or signaled has occurred. These functions are discussed in Posting and signaling events. When the condition is satisfied or the event specified by event_name has occurred, the terminal is ready to begin program execution when its intermessage delay has expired.

The WAIT UNTIL statement may imply a TRANSMIT USING ENTER. If TYPE statements have been processed since the last Transmit Interrupt, the WAIT UNTIL statement sends the messages.

The following two sections of code do exactly the same thing:
transmit using clear
type 'Hello'
wait until onin substr(data,1,1) = 'X'

or

transmit using clear
type 'Hello'
transmit using enter and wait until onin substr(data,1,1) = 'X'
In both cases, the message is transmitted before the terminal begins waiting.
The QUIESCE UNTIL statement uses this syntax:
        ┌                                        ┐
QUIESCE │ UNTIL {ONIN [asynchronous_condition]}  |
        │       {ONOUT [asynchronous_condition]} |
        │       {SIGNALED(event_name)}           |
        ⋘                                        ┘ 
The QUIESCE statement enables you to specify optionally the conditions that release a terminal from a quiesced state, as shown in the following example.
/* Quiesce until the terminal receives the string 'WAKE UP'. */

quiesce until onin index(screen,'WAKE UP') > 0
Like the WAIT UNTIL statement, the QUIESCE UNTIL statement may imply a TRANSMIT.