TACL Reference Manual
Built-In Functions and Variables
HP NonStop TACL Reference Manual—429513-018
9-233
#LINEFINDRV Built-In Function
#LINEFINDRV Built-In Function
Use #LINEFINDRV to find a string in a variable level, searching backward from a
specified line.
EXACT
specifies that the search is to be case-sensitive; if you omit it, the search makes no
distinction between uppercase and lowercase letters.
variable-level
is an existing variable level within which TACL will search for string. It must not be
a DIRECTORY, a STRUCT, or a STRUCT item.
line-addr
is an integer or a variable level that contains an integer. line-addr specifies the
line number at which the search is to begin. The line address must be in the range
from 1 to max-int, inclusive. The search moves backward from this point.
string
is the string constant or the name of a variable level that contains text. string
specifies the characters to be found. It must not be in a shared segment or be a
DIRECTORY, a STRUCT, or a STRUCT item. The largest valid string length is
32,000 words minus the current contents of the stack. The amount of remaining
space is typically 25,000 words long.
Result
#LINEFINDRV returns the number of the line in which string begins. If string is not
found, or if string is empty, #LINEFINDRV returns zero. If variable-level is empty,
then #LINEFINDRV returns zero.
Considerations
•
Ifline-addr is past the end of the variable level, #LINEFINDRV starts the search
at the end of the contents of the variable.
•
One trailing end-of-line in string is ignored. Leading and trailing spaces are
preserved, as are all other end-of-lines.
•
The search includes all of the specified line. The search finds a match if the
matching string begins anywhere within, or before, that line (even if the string
extends beyond the line). If you make repeated calls to this function, using the
result of one call as a starting point for the next, you must subtract one from that
#LINEFINDRV [ / EXACT / ] variable-level line-addr string