TACL Reference Manual
Built-In Functions and Variables
HP NonStop TACL Reference Manual—429513-018
9-419
#WAIT Built-In Function
#WAIT Built-In Function
Use #WAIT to specify the variable level(s) for which you require TACL to wait. TACL
does not execute the next instruction until the variable is ready. The conditions that
define ready depend on the purpose for which the variable level is used and are listed
under “Considerations.”
variable-level
is the name of a variable level for which the routine must wait.
Result
#WAIT returns the name and level number of the first variable level that is ready.
Considerations
These guidelines apply to the use of the #WAIT built-in function:
•
These criteria determine whether a variable level is ready:
°
If a variable level is not in use by a process, #SERVER, or #REQUESTER, the
#WAIT built-in function always considers it ready.
°
If a variable level is in use by a #SERVER or the DYNAMIC IN of a process, it
is ready if it is empty (all data has been sent and the process is waiting for
input).
°
If a variable level is in use by a #SERVER or the OUT or STATUS of a
process, it is ready if it is not empty (data or status is available).
°
If a variable level is in use as the error variable of a #REQUESTER, it is ready
if it is not empty (an error has occurred). TACL sets such a variable level only if
an error occurs, not if the I/O operation is successful.
°
If a variable level is in use by a READ #REQUESTER read variable, it is ready
if it is not empty (data is available).
°
If a variable level is in use by a WRITE #REQUESTER write variable, it is
ready if it is empty (all data has been written).
•
If you want to ensure that #WAIT always returns immediately, create an additional
variable level, not used for I/O, and specify its name last in the WAIT list.
•
To access only the topmost level of a variable, regardless of its level number, you
could invoke the #WAIT function as follows:
#PUSH error^var read^var prompt^var
[#CASE [#VARIABLEINFO /VARIABLE/
[#WAIT error^var read^var prompt^var] ]
#WAIT variable-level [ variable-level ] ...