Download CML User's Guide

Transcript
Chapter 6
CML List
6.9. Comparison Operators
These operators compare two numbers to determine whether or not they meet the conditions and return the
results of comparison.
The value representing the result of the comparison is Boolean. Any number is required to be integer and
defined value in V(variable)
Operator
Functions
Format
Examples
Description
Result is TRUE if number1 is equal to number2.
==
Equal to
[number1] == [number2]
Otherwise FALSE.
V1.1 == V2.1
V1.1 == V2.1 + V3.1
Ex.) If V1.1=100, V2.1=100, then TRUE
If V1.1=100, V2.1=50, V3.1=50, then TRUE
Result is TRUE if number1 is not equal to number2.
!=
Not Equal to [number1] != [number2]
Otherwise FALSE.
V1.1 != V2.1
V1.1 != V2.1 + V3.1
Ex.) If V1.1=100, V2.1=100, then FALSE
If V1.1=100, V2.1=50, V3.1=50, then FALSE
Result is TRUE if number1 is greater than number2.
>
Greater than [number1] > [number2]
Otherwise FALSE.
V1.1 > V2.1
V1.1 > V2.1 + V3.1
Ex.) If V1.1=110, V2.1=100, then TRUE
If V1.1=100, V2.1=50, V3.1=50, then FALSE
Result is TRUE if number1 is greater than or equal
>=
Greater than
or equal to
to number2.
Otherwise FALSE.
[number1] >= [number2]
V1.1 >= V2.1
V1.1 >= V2.1 + V3.1
Ex.) If V1.1=110, V2.1=100, then TRUE
If V1.1=100, V2.1=50, V3.1=70, then FALSE
Result is TRUE if number1 is less than number2.
<
Smaller than [number1] < [number2]
Otherwise FALSE.
V1.1 < V2.1
V1.1 < V2.1 + V3.1
Ex.) If V1.1=110, V2.1=100, then FALSE
If V1.1=100, V2.1=50, V3.1=70, then TRUE
Result is TRUE if number1 is less than or equal to
<=
Smaller than
or equal to
number2.
Otherwise FALSE.
[number1] <= [number2]
V1.1 <= V2.1
V1.1 <= V2.1 + V3.1
Ex.) If V1.1=110, V2.1=100, then FALSE
If V1.1=100, V2.1=50, V3.1=50, then TRUE
The following table contains a list of the relational comparison operators and the conditions that determine
whether result is TRUE or FALSE.
Operator
TRUE if
==
number1 == number2
!=
number1 != number2
>
number1 > number2
>=
number1 >= number2
<
number1 < number2
<=
number1 <= number2
FALSE if
number1 != number2
number1 == number2
number1 <= number2
number1 < number2
number1 >= number2
number1> number2
139