Previous Topic: VVALUE()Next Topic: WTO()


WAIT()

This function directs an IMOD to wait for a POST operation on a stack.

Syntax

stknum = WAIT(n,[n],[n],...,[n])

Parameters

stknum

Number of the stack that satisfied the requirements for ending the wait (or error text).

n

Number of a stack to wait on. Up to 20 stacks can be waited on. All specified stacks must be empty or WAIT() completes immediately. If multiple stacks are specified, a POST operation that is issued against any stack causes WAIT() to complete.

Return Codes

101 - 120

ARG n MISSING OR INVALID

121

NO STACKS SPECIFIED

Example

num = wait(1,2,3)   /* Wait for a record to appear on any of 3 stacks    */
rec = pull(num)     /* Read the record that caused the wait  to complete */

Usage Notes

When a WAIT() is issued against one or more stacks, each specified stack is inspected for existing records. If any records are found, no wait is performed. Following the completion of the function, the number of the first non-empty stack is returned as the result of the function.

When a WAIT() is issued against empty stacks, the IMOD task is suspended. Execution is resumed when another IMOD task uses a function that specifies post, such as PUSH(), QUEUE(), and SHOVE(). The function providing the post can provide accompanying stack records.