TACL Reference Manual

Built-In Functions and Variables
HP NonStop TACL Reference Manual429513-018
9-88
#DEF Built-In Function
PRIVATE
specifies that the creator of the segment file has read and write access to
the file and that no other process may open it.
SHARED
specifies that the segment file is a read-only file and that other processes
may open it for read access.
file-name
is the name of a TACL segment file. If file-name does not exist, TACL
creates it and initializes it as an empty TACL segment.
STRUCT structure-body
specifies that variable represents a structure.
structure-body
is a set of declarations for data, substructures, FILLER bytes, or redefinitions,
as described in Section 4, Variables. All internal square brackets in the body
are expanded before the structure is declared.
Result
#DEF returns nothing.
Considerations
If you specify a segment file in a DIRECTORY definition, the segment file must
reside on the local system (where the TACL process is executing).
If the #DEF declaration contains a |BODY| label, it must be enclosed in square
brackets. For a DIRECTORY or STRUCT definition, square brackets are required
only if the entire #DEF cannot be contained in one line and you prefer not to use
the ampersand (&) continuation character.
The |BODY| label, used in the enclosure that defines ordinary variables, is not
used in a DIRECTORY or STRUCT definition.
#DEF does not always behave exactly the same as a #PUSH-#SET combination:
For example, #SET A BB[CCC]DDDD invokes [CCC] to obtain the contents of the
variable level CCC before assigning the result to the variable level A. On the other
hand, [#DEF A type |BODY| BB[CCC]DDDD] assigns the value BB[CCC]DDDD to
A, including the brackets, leaving the expansion to be done when A is invoked.
This may cause unexpected results, especially if type is DELTA.
Do not try to use #DEF on the root directory (:). If you try this, TACL returns
“*ERROR* Cannot push or pop the root segment's root.” In addition, to avoid losing