TACL Reference Manual
Variables
HP NonStop TACL Reference Manual—429513-018
4-5
Deleting a Variable
Deleting a Variable
Table 4-3 lists TACL functions that delete variables.
Accessing Variable Contents
The mechanism for accessing variable contents depends on the context:
•
To access the contents of a variable from a location that expects text, enclose the
variable name in square brackets ([]). When TACL encounters a variable name in
square brackets, it replaces the variable name with the contents of the variable;
this action is known as expanding a variable. For example:
#OUTPUT [var1]
If the variable is a routine that contains TACL statements, TACL replaces the
variable name with its associated statements, interprets the statements, and
produces results as directed by the statements. The result ends up in place of the
variable name, making the result very accessible to your program.
If you include a level number within the square brackets, TACL expands the
contents of the variable level. If you omit the level number, TACL expands the top
level of the variable.
•
If you are calling a variable as a simple function, then you do not need to surround
the function call with brackets. This example shows a #SET function call without
square brackets surrounding it:
#SET temp 123
•
If a statement within a variable contains an enclosure, include brackets to delimit
the enclosure:
[#IF level > limit |THEN|
#OUTPUT Over limit
Table 4-3. Functions and Commands That Delete Variables
Command
(Interactive)
Function
(Programmatic) Description
POP #POP Removes a level from the top of a variable
KEEP #KEEP Removes one or more levels from the bottom of a
variable
- #UNFRAME Pops all variable levels pushed since the last #FRAME
operation
- #RESET
FRAMES
Performs an #UNFRAME operation for all frames with
frame numbers higher than they were when a routine
was entered
If not called from a routine, TACL performs an
#UNFRAME operation for all frames with numbers
higher than they were when the last prompt was issued.