TACL Reference Manual

Built-In Functions and Variables
HP NonStop TACL Reference Manual429513-018
9-61
#CHARGET Built-In Function
#CHARGET Built-In Function
Use #CHARGET to obtain a copy of a set of contiguous characters in a variable level.
variable-level
is an existing variable level from which characters are to be copied. It must not be
a DIRECTORY, a STRUCT, or a STRUCT item.
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
#CHARGET returns the copied characters.
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.
If any part of the specified copy lies beyond the end of the variable level, that part
is ignored.
If the result of #CHARGET might possibly include one or more internal end-of-
lines, you must enclose in square brackets the invocation of the function that
obtains that result.
#CHARGET variable-level char-addr-1
[ [ FOR char-count ] | [ TO char-addr-2 ] ]