Using INV and OUTV
Initiating and Communicating With Processes
5–16
107365 Tandem Computers Incorporated
Generating Commands
Because data transfer occurs through variables, be careful when moving data to and
from the variables. For example, when a process is running in the nowait mode, it is
possible to attempt an operation before the preceding operation has finished.
Caution
Data can be unexpectedly lost or duplicated during data transfer. To avoid lost or duplicated data, follow
these guidelines.
Use #APPEND or #APPENDV to manage IN variables. Each of these functions
appends a line to a variable level in such a way that no data is lost or removed. Do
not expect to examine data you have put into an IN variable—the data can be sent
as soon as you append it to the variable. (If you use #SET instead of #APPEND to
manage IN variables, queued lines in the IN variable can be lost before they are
sent.)
Use #EXTRACT or #EXTRACTV to manage OUT variables. Each of these
functions removes the first line from a variable level in such a way that no data is
lost if the process is simultaneously adding lines to a variable level. If you use
#OUTPUTV to display an OUT variable and then use #SET to clear it, a new line
could arrive between the #OUTPUT and the #SET; that line would be lost.
Use #WAIT to delay processing until one of a list of variable levels is ready.
#WAIT returns the fully qualified name of that variable level.
The OUT and PROMPT variables are ready if they have data in them.
An IN variable is ready if it is empty and a process is waiting for you to put
data into it.
A STATUS variable is ready if its process was deleted.
Any other variable is always ready.
Use #EOF to cause an end-of-file on an IN variable. If the IN variable is empty
and a process is waiting, an end-of-file is immediately sent to the process. If the
IN variable is empty and a process is not waiting, a flag is set. The next time the
process attempts to read from the empty IN variable, TACL sends an EOF and the
flag is cleared. #EOF does not alter the state of the process or the IN variable, but
it can cause the process to terminate.
The following examples illustrate the use of INV and OUTV.