TACL Reference Manual

Built-In Functions and Variables
HP NonStop TACL Reference Manual429513-018
9-63
#CHARGETV Built-In Function
#CHARGETV Built-In Function
Use #CHARGETV to copy a set of contiguous characters from one variable level to
another.
var-1
is an existing variable level from which characters are to be copied. It must not be
a DIRECTORY, a STRUCT, or a STRUCT item.
var-2
is an existing variable level that is to receive the copy. Its original contents are lost
and its type is set to TEXT.
char-addr-1
is an integer greater than zero or a variable level that contains an integer greater
than zero. char-addr-1 specifies the character position at which copying is to
begin. The character position must be in the range from 1 to max-int, inclusive.
char-count
is an integer greater than zero or a variable level that contains an integer greater
than zero. char-count specifies the number of characters to be copied. The
character count must be in the range from 0 to max-int, inclusive.
char-addr-2
is an integer greater than zero or a variable level that contains an integer greater
than zero. char-addr-2 specifies the character position at which copying is to
end. The character position must be in the range from 1 to max-int, inclusive.
Result
#CHARGETV returns nothing.
Considerations
If you use TO, the character specified by char-addr-2 is included in the copy:
That is, “x TO y” is equivalent to “x FOR (y-x)+1.”
If you use TO and char-addr-1 is greater than or equal to char-addr-2, or if
you use FOR and char-count is less than one, no copying occurs.
If you omit both FOR and TO, one character is copied.
If char-addr-1 is less than 1, an error occurs.
#CHARGETV var-1 var-2 char-addr-1
[ [ FOR char-count ] | [ TO char-addr-2 ] ]