This topic provides code samples of how to compare variables using logical operators.
-
Checks if two variables are equal
myIntegerA = myIntegerB
-
Checks if two variables are not equal
myIntegerA <> myIntegerB
-
Checks if the variable on the left is less than the variable on the right
myIntegerA < myIntegerB
-
Checks if the variable on the left is greater than the variable on the right
myIntegerA > myIntegerB
-
Checks if the variable on the left is less than or equal to the variable on the right
myIntegerA <= myInteger
-
Check if the variable on the left is greater than or equal to the variable on the right
myIntegerA >= myInteger
-
Both conditions must be true for the entire expression to be true
myIntegerA = myIntegerB And myIntegerC > myIntegerB
-
At least one condition must be true for the entire expression to be true
myIntegerA = myIntegerB Or myIntegerC > myIntegerB
-
Exactly one condition must be true for the entire expression to be true
myIntegerA = myIntegerB Xor myIntegerC > myIntegerB
-
Negates the logical expression, in this case, both conditions in the parentheses must be false for the entire expression to be true
Not (myIntegerA = myIntegerB Or myIntegerC > myIntegerB)