TACL Reference Manual

Built-In Functions and Variables
HP NonStop TACL Reference Manual429513-018
9-341
#SERVER Built-In Function
#SERVER Built-In Function
The #SERVER built-in function allows you to use your TACL process to interact with
one or more other processes. This mechanism is an alternative to the use of INV and
OUTV or the use of INLINE commands. Processes open your TACL process as if it
were a file. Your TACL process can then read requests and respond to them. You can
control processes, such as utilities, and interpret their responses.
The name defined by #SERVER remains in existence until you delete it with another
call to #SERVER (with the KILL option).
Your TACL must have a process name for you to be able to use #SERVER.
option
can be any of these:
IN variable-level
specifies a variable level to be used to supply data to WRITEREAD procedures
called by requesters. The first line of the variable level is removed and given to
each WRITEREAD. If the variable level is empty, WRITEREAD waits until data
is placed into the variable level. To avoid race conditions (see Considerations
on page 9-342), use #APPEND or #APPENDV to add data to this variable
level. You cannot read data out of this variable level, as the data might be
passed immediately to a process and therefore be no longer available.
To send an end-of-file, use #EOF. If the IN variable is empty and a process is
waiting, TACL sends an end-of-file immediately; otherwise, TACL sets a flag.
The next time the process tries to read from the empty server file, TACL sends
an end-of-file and clears the flag. #EOF does not alter the state of the server
file or the IN variable, but it can cause the process to terminate, which can alter
the state of the server file.
OUT variable-level
specifies the variable level to be used to accept data from WRITE procedures
called by requesters. WRITEs are appended one line at a time to the variable
level. To avoid race conditions (see Considerations
on page 9-342), use
#EXTRACT or #EXTRACTV to obtain data from this variable level. You must
not read and then clear this variable level as more data can arrive between the
read and the clear, and that data is then lost.
PROMPT variable-level
specifies the variable level that is to contain the most recent data sent by a
WRITEREAD. Previous data in the variable level is lost each time a
WRITEREAD occurs.
#SERVER / option [ , option ] ... / [ name ]