TACL Reference Manual

Built-In Functions and Variables
HP NonStop TACL Reference Manual429513-018
9-237
#LINEGET Built-In Function
#LINEGET Built-In Function
Use #LINEGET to obtain a copy of a set of consecutive lines in a variable level.
string
is an existing variable level or quoted text from which lines are to be copied. It must
not be a DIRECTORY, a STRUCT, or a STRUCT item.
line-addr-1
is an integer or a variable level that contains an integer. line-addr-1 specifies
the line number at which copying is to begin. The line address must be in the range
from 1 to max-int, inclusive.
line-count
is an integer or a variable level that contains an integer. line-count specifies the
number of lines to copy. The line count must be in the range from 0 to max-int,
inclusive.
line-addr-2
is an integer or a variable level that contains an integer. line-addr-2 specifies
the line number at which copying is to end. The line address must be in the range
from 1 to max-int, inclusive.
Result
#LINEGET returns as its result the copied lines.
Considerations
If you use TO, the line specified by line-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 line-addr-1 is greater than or equal to line-addr-2, or if
you use FOR and line-count is zero, no copying occurs.
If you omit both FOR and TO, one line is copied.
Any part of the specified copy that lies beyond the end of the variable level is
ignored.
If #LINEGET is to return more than one line, you must enclose in square brackets
the invocation of the function that obtains that result.
#LINEGET string line-addr-1
{ { FOR line-count } | { TO line-addr-2 } }