|
Comparisons
The basic Boolean expressions compare between two expressions:
<expr1> _EQ_ <expr2> Equal
<expr1> == <expr2> Equal
<expr1> _NE_ <expr2> Not Equal
<expr1> != <expr2> Not Equal
<expr1> _LT_ <expr2> Less Than
<expr1> < <expr2> Less Than
<expr1> _LE_ <expr2> Less than or Equal
<expr1> <= <expr2> Less than or Equal
<expr1> _GT_ <expr2> Greater Than
<expr1> > <expr2> Greater Than
<expr1> _GE_ <expr2> Greater than or Equal
<expr1> >= <expr2> Greater than or Equal
Notes:
-
It is possible to compare expressions of different types (that is, one numeric expression and one string expression). However, this is not recommended, and may lead to unexpected results.
-
In the old GPP, only the _XX_ comparison operators were supported. In GPP2, new "standard" operators were added (after the operators used in the C Programming Language). Both forms are supported, and can be used freely.
-
See the following sections on exactly how expressions are compared:
Comparing Numeric Expressions
Comparing String Expressions
Comparing Mixed Expressions - Not Recommended.
|