TACL Reference Manual

Built-In Functions and Variables
HP NonStop TACL Reference Manual429513-018
9-223
#LINEADDR Built-In Function
#LINEADDR Built-In Function
Use #LINEADDR to convert a character address to a line address.
variable-level
is an existing variable level to be operated upon. It must not be a DIRECTORY, a
STRUCT, or a STRUCT item.
char-addr
is an integer or a variable level that contains an integer. char-addr specifies the
character address of the character to be converted. The character address must
be in the range from 1 to max-int, inclusive.
Result
#LINEADDR returns the line number of the line that contains the specified character.
Considerations
If char-addr is greater than the number of characters in the variable level,
#LINEADDR returns a value one greater than the number of the last line.
If variable-level is empty, #LINEADDR returns 0.
Each logical line contains an end-of-line character that counts as one byte. For
variables that contain TACL statements, each metacharacter uses the number of
visible characters plus one, including unprintable characters that are subject to
change from one TACL RVU to another. Nonmetacharacters use one byte.
Example
Assume that var is a variable level containing:
ABCDEFG
HIJKLMNOPQRST
UVWXYZ
The invocation:
#LINEADDR var 10
returns 2; the tenth character in var, counting the end-of-line between lines 1 and 2 as
one character, is the “I” in line 2.
#LINEADDR variable-level char-addr