TACL Reference Manual
Built-In Functions and Variables
HP NonStop TACL Reference Manual—429513-018
9-323
#REQUESTER Built-In Function
CLOSE variable-level
closes the file and deletes the requester associated with variable-level. If it is
a write requester, use #WAIT on write-var to ensure that all data in the write
variable has been written to the file before you delete the requester.
variable-level
is any one of the variable levels used when #REQUESTER was invoked to
open a file. For example, if you start a requester with the READ option, you
can specify the same error-var, read-var, or prompt-var with the
CLOSE option. A given variable level can be associated with only one
requester or server at any time. The variable level must not be a DIRECTORY,
STRUCT, or a STRUCT item.
READ file-name error-var read-var prompt-var
creates a read requester and opens file-name for reading. For each line
appended to prompt-var, the requester reads a record from file-name and
appends it to read-var. If file-name is a terminal or a process, appending a
line to prompt-var causes the value of the variable to be transmitted as a
prompt. If you use the WAIT option, TACL begins executing subsequent code, but
if it encounters #APPEND(V) or #EXTRACT(V) that refers to a requester variable,
it waits until the I/O operation is finished.
If you do not use WAIT, TACL continues execution. To avoid reading incorrect
data, use the #WAIT function. Use #APPEND(V) prompt-var and #EXTRACT(V)
read-var instead of the #SET(V) built-in functions. If an error occurs, error-
var is set to the error number and further I/O operations on the requester stop until
you clear error-var by setting it to a null value.
file-name
is the name of the file to be read. If the file does not exist, an error occurs. Both
format 1 and format 2 files (unstructured, file code 0 format 2 files only) can be
read.
error-var
is the name of a variable level to hold error codes.
read-var
is the name of a variable level to hold the data read.
prompt-var
is the name of a variable level to hold one prompt for each line to be read.
Note. The variable level cannot be a DIRECTORY, STRUCT, or STRUCT item.