TACL Reference Manual

Variables
HP NonStop TACL Reference Manual429513-018
4-6
Using a Variable as an Argument
|ELSE|
#OUTPUT Value is OK
]
To expand a result or the contents of a variable, include an extra set of brackets
beyond any others required by the foregoing rules.
Using a Variable as an Argument
To specify a variable as an argument to a function that expects a variable name, an
expression, or a string (passing the variable by name), enter the variable name:
#OUTPUTV var1
TEXT Variables
A text variable can contain:
Integer or text data as defined in Section 2, Lexical Elements.
TACL statements as defined in Section 5, Statements and Programs.
Sample Declarations
This TACL statement creates a TEXT variable called x:
#PUSH x
This TACL statement creates a TEXT variable called var1 and assigns the value 3 to
var1:
[#DEF var1 TEXT |BODY| 3]
This example creates a TEXT variable called printit; this variable contains TACL
statements:
?SECTION printit TEXT
#OUTPUT Here is line one
#OUTPUT Here is line two
#OUTPUT I'm finished!
To use this code, you must first load the file that contains the code. For more
information, see Section 6, The TACL Environment.
ALIAS Variables
An alias is a limited variable; its contents must be exactly one word-the name of a
variable or a file. (Comments of the == and { } forms are allowed, because TACL
deletes them; but COMMENT lines are not allowed, because they remain.) An alias is
simply a name for something else; for example, the variable S could be an alias for
STATUS.