TACL Reference Manual

Built-In Functions and Variables
HP NonStop TACL Reference Manual429513-018
9-56
#CHARFINDR Built-In Function
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.
Examples
Assume that var is a variable level containing:
ABCDEFG
HIJKLMNOPQRST
UVWXYZ
1. The invocation:
#CHARFINDR var 28 IJK
returns 10; the nearest occurrence of IJK ending before character address 28
starts at character address 10.
2. The invocation:
#CHARFINDR var 14 IJK
returns 10; the nearest occurrence of IJK ending before character address 14
starts at character address 10.
3. The invocation:
#CHARFINDR var 12 IJK
returns 10.
4. The invocation:
#CHARFINDR var 28 FOO
returns 0; there are no occurrences of FOO anywhere in var.
5. This set of statements returns 3:
#PUSH x
#SET x ABCDEFG
#CHARFINDR x [#CHARCOUNT x] C
The occurrence of C is three characters from the start of the contents of variable x.