Control Structures

Comparison operators

Different comparison operators are available for numbers and strings:

Comparison

Numeric

String

Equal

==

eq

Not equal

!=

ne

Less than

<

lt

Greater than

>

gt

Less than or equal to

<=

le

Greater than or equal to

>=

ge

You may use not, and and or inside the conditional expression.

Their order of precedence (from highest to lowest) is not, and, or. To override that, use parentheses ().

For exampl: if (($a ge 0) and ($a le 10)){...}


Table of Contents.
Previous | Next.