
Using INV and OUTV
Initiating and Communicating With Processes
5–14
107365 Tandem Computers Incorporated
Using INV and OUTV
The INV and OUTV options for the RUN command and the #NEWPROCESS built-in
function allow you to use variables in place of IN and OUT files. To use INV or
OUTV, your TACL process must be a named process. You cannot use IN and INV
together for the same process; nor can you use OUT and OUTV together. You can,
however, start more than one process with different sets of INV and OUTV variables
to communicate with more than one process.
When you use INV, the contents of the associated variable are passed line by line to
the process as the process reads from its input method. There are two ways to use
INV:
Static (default): Provides a batch-type environment. Set the variable to the desired
contents and start the process. TACL sends the lines one-by-one to the process.
This mechanism acts much like a file. When all of the lines in the variable have
been sent, subsequent reads get an end-of-file indication. You cannot add lines to
the variable or change the variable after the process has started; if you attempt to
add lines, TACL returns an error.
Dynamic: Provides an interactive-type environment. You can add lines at any
time during the life of the process. To specify dynamic, include the word
DYNAMIC after the variable name in the INV option. TACL sends the lines one-
by-one to the process. If the variable is empty, the process waits until the variable
contains data.
If you use a dynamic INV variable, you can use the PROMPT option to capture
prompts. TACL places the most recent prompt string from the process into this
variable.
To specify an INV or OUTV variable, start the process with a RUN or #NEWPROCESS
command and include INV or OUTV and associated variables. To send a command,
append the command to the variable associated with INV. To retrieve output, extract
lines from the variable associated with OUTV.
When the process sends a WRITEREAD, TACL stores the prompt in the PROMPT
variable (if requested with the INV PROMPT option), removes the first line of the IN
variable, and passes it to the process. If the IN variable is empty, the process waits
until you put data into the IN variable.
When the process writes to your program, TACL appends the line to the end of the
OUT variable associated with the process. You can capture the output into a queue,
examine the contents of the queue, and enable and disable output to the queue.