TACL Reference Manual
Built-In Functions and Variables
HP NonStop TACL Reference Manual—429513-018
9-70
#COMPAREV Built-In Function
#COMPAREV Built-In Function
Use #COMPAREV to compare one string with another.
string-1 and string-2
are the names of variable levels of a type other than DIRECTORY, text enclosed in
quotation marks, or concatenations of such entities. The concatenation operator is
'+' (the apostrophes are required).
Result
#COMPAREV returns a nonzero value if the contents of the two arguments are the
same; it returns zero if they are different.
Considerations
•
The comparison is not case-sensitive; that is, an uppercase character is equal to
its lowercase counterpart.
•
You can compare any combination of STRUCTs and STRUCT items with each
other; such comparisons are case-sensitive.
•
You can compare any combination of variable levels that are not STRUCTs or
STRUCT items (except type DIRECTORY); such comparisons are not case-
sensitive.
•
To compare a string to a template, use the #MATCH built-in function.
Example
1. This example shows how a variable level can be compared with quoted text.
#PUSH termname term_is_mine
#SET termname [#MYTERM]
2. This example returns a nonzero value if #MYTERM is "$MINE".
#SET term_is_mine [#COMPAREV termname "$MINE"]
#COMPAREV string-1 string-2