TACL Reference Manual

Built-In Functions and Variables
HP NonStop TACL Reference Manual429513-018
9-57
#CHARFINDRV Built-In Function
#CHARFINDRV Built-In Function
Use #CHARFINDRV to find a string constant in a variable level, searching backward
from a specified character address.
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.
char-addr
is an integer greater than zero or a variable level that contains an integer greater
than zero. char-addr specifies the character address at which the search is to
begin. The character 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
#CHARFINDRV returns the character address at which string begins. If string is not
found, #CHARFINDRV returns zero.
Considerations
If char-addr is past the end of the variable level, #CHARFINDRV starts the
search at the end of the contents of the variable.
The trailing end-of-line in string is ignored. Leading and trailing spaces are
preserved, as are all other end-of-lines.
The search begins immediately at the character address specified. Because the
search does not find a match unless the entire matching text appears at or before
char-addr, you must specify a starting address beyond the end of a variable
level ([#CHARCOUNT] or greater) to find text at the end of it.
If variable-level is empty, then #CHARFINDRV returns zero.
#CHARFINDRV [ / EXACT / ] variable-level char-addr string