Use WAIT() to direct an IMOD to wait for a POST operation on a stack.
The WAIT() function has this syntax:
stknum = WAIT(n,[n],[n],...,[n])
The WAIT() function takes these arguments:
Number of the stack that satisfied the requirements for ending the wait (or error text).
Number of a stack to wait on. Up to twenty stacks can be waited on. All specified stacks must be empty or WAIT() completes immediately. If multiple stacks are specified, a POST operation issued against any stack causes WAIT() to complete.
The WAIT() function produces these return codes:
ARG n MISSING OR INVALID
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 */
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 completion of the function, the number of the first non-empty stack is returned as the function's result.
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 may provide accompanying stack records.
| Copyright © 2012 CA. All rights reserved. | Tell Technical Publications how we can improve this information |