TACL Reference Manual

Built-In Functions and Variables
HP NonStop TACL Reference Manual429513-018
9-53
#CHARFIND Built-In Function
#CHARFIND Built-In Function
Use #CHARFIND to find text in a variable level, searching forward 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 text. 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.
text
is the text constant to be found. The largest valid text length is 32,000 words minus
the current contents of the stack. The amount of remaining space is typically
25,000 words long.
Result
#CHARFIND returns the character address at which text begins. If text is not found,
#CHARFIND returns zero.
Considerations
If char-addr is past the end of the variable level, #CHARFIND returns zero.
A text specification can include internal end-of-line characters if the entire
invocation is enclosed in square brackets, but leading and trailing end-of-lines and
spaces are ignored.
The search begins immediately at the character address specified. If you make
repeated calls to this function, using the result of each as a starting point for the
next, you must add one to that result before supplying it to a subsequent call.
If variable-level is empty, #CHARFIND returns zero.
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
#CHARFIND [ / EXACT / ] variable-level char-addr text