TACL Reference Manual
Built-In Functions and Variables
HP NonStop TACL Reference Manual—429513-018
9-363
#SETV Built-In Function Use
#SETV Built-In Function Use
#SETV to copy a string to an existing variable level.
dest-variable-level
is the variable level that is to receive the copy; it must already exist. Its original
contents are lost.
source-variable
is the name of an existing variable that contains the string to be copied. source-
string remains unchanged. It must not be of type DIRECTORY, be text enclosed
in quotation marks, or be a concatenation of such entities. The concatenation
operator is '+' (the apostrophes are required).
Result
#SETV returns nothing.
Considerations
•
If the destination variable is of a different type than the source variable, the
destination variable inherits the type as well as the contents of the source variable.
•
If a variable maintains a connection to a file, device, or process, such as a
connection established by #REQUESTER, and #SETV sets the variable to a new
value, the original connection is dropped because TACL deletes the original
contents of the variable.
•
When the source string is a structure, the destination variable level becomes a
structure like the source structure and contains its own copy of the data.
•
To change the contents of a variable level or built-in variable, use the #SET built-in
function.
•
To distribute the members of a space-separated list into several individual variable
levels, use the #SETMANY built-in function.
Example
This example shows a combination of a variable name and quoted text in the source
string:
#PUSH var termname
#SET termname [#MYTERM]
#SETV var "My terminal is " '+' termname '+' " at this time."
#SETV dest-variable-level source-variable