NET/MASTER Network Control Language (NCL) Reference Manual

Relational Operators and Expressions
Expressions and Operators
106126 Tandem Computers Incorporated 10–15
Strict Relational Operators
Strict relational operators compare the two terms as they are. No stripping or padding
is done, and the terms are always compared as character strings. If the two terms are
equal up to the shorter length, the longer term is regarded as greater than the shorter
term, and the appropriate truth value returned. If the two terms are not equal up to
the shorter length, then the term that is greater at that point is greater regardless of the
length. The following examples compare lengths:
a is less than 'a '
a is greater than ' '
a is greater than ' a'
Lowercase letters are not converted to uppercase when the comparison is performed.
Note For the sake of efficiency, use the strict equal sign (==) whenever leading or trailing blanks are intrinsic
parts of the strings being compared.
Table 10-4 lists strict relational operators. All operators have the same level of
precedence.
Table 10-4. Strict Relational Operators
Operator Operation Comment
== Strict equal to Performs a strict test of equality.
\== Strict not equal to Performs a strict test of non equality.
<< Strict less than Performs a strict less than test.
>> Strict greater than Performs a strict greater than test.
<<= Strict less than or equal to Performs a strict less than or equal to test.
>>= Strict greater than or equal to Performs a strict greater than or equal to test.
Relational Expressions You can assign the result of the comparison to a variable. For example, the expression
&result = &x > &y tests whether or not the value of &x is greater then the value of &y.
The following table shows the value of &result after the comparison:
Possibility Value of &result
If &x is greater then &y 1
If &x is less than &y 0
If &x is equal to &y 0