How Can We Help?
Operators
Equal (=) Function
The equal operator is used to assign a value to a variable or vector, or to compare values.
When used for assignment, a single variable or vector on the left side of the = operator is given the value determined by one or more variables, vectors, and/or expressions on the right side. Also, the SET keyword must precede the variable name when the = operator is used for an assignment:
SET A = 123
SET B = 123
A = B = TRUE
Greater Than (>) Function
The > operator determines if the first expression is greater-than the second expression.
Example:
SET A = 124
SET B = 123
A > B = TRUE
Less Than (<) Function
The < operator determines if the first expression is less-than the second expression.
Example:
SET A = 123
SET B = 124
A > B = TRUE
Greater Than or Equal To (>=) Function
The >= operator determines if the first expression is greater-than or equal to the second expression.
Example:
SET A = 123
SET B = 123
A >= B = TRUE
And:
SET A = 124
SET B = 123
A >= B = TRUE
Less Than or Equal To (<=) Function
The <= operator determines if the first expression is less-than or equal to the second expression.
Example:
SET A = 123
SET B = 123
A <= B = TRUE
And:
SET A = 123
SET B = 124
A <= B = TRUE
Not Equal (<> or !=) Function
Both the != and the <> inequality operators determine if the first expression is not equal to the second expression.
Example:
SET A = 123
SET B = 124
A != B = TRUE
AND Function
The AND operator is used to perform a logical conjunction on two expressions, where the expressions are Null, or are of Boolean subtype and have a value of True or False.
The AND operator can also be used a “bitwise operator” to make a bit-by-bit comparison of two integers. If both bits in the comparison are 1, then a 1 is returned. Otherwise, a 0 is returned.
When using the AND to compare Boolean expressions, the order of the expressions is not important.
Example:
(TRUE = TRUE AND FALSE = FALSE) = TRUE
And:
(TRUE = TRUE AND FALSE = TRUE) = FALSE
OR Function
The OR operator is used to perform a logical disjunction on two expressions, where the expressions are Null, or are of Boolean subtype and have a value of True or False.
The OR operator can also be used a “bitwise operator” to make a bit-by-bit comparison of two integers. If one or both bits in the comparison are 1, then a 1 is returned. Otherwise, a 0 is returned.
When using the OR to compare Boolean expressions, the order of the expressions is important.
Example:
(TRUE = TRUE OR TRUE = FALSE) = TRUE
And:
(FALSE = TRUE OR TRUE = FALSE) = FALSE
XOR Function
The XOR operator is used to perform a logical exclusion on two expressions, where the expressions are Null, or are of Boolean subtype and have a value of True or False.
The XOR operator can also be used a “bitwise operator” to make a bit-by-bit comparison of two integers. If both bits are the same in the comparison (both are 0’s or 1’s), then a 0 is returned. Otherwise, a 1 is returned.
Example:
(TRUE XOR FALSE) = TRUE
And:
(FALSE XOR FALSE) = FALSE
NOT Function
The NOT operator is used to perform a logical negation on an expression. The expression must be of Boolean subtype and have a value of True or False. This operator causes a True expression to become False, and a False expression to become True.
Example:
NOT (TRUE = FALSE) = TRUE
And:
NOT (TRUE = TRUE) = FALSE
EQV Function
The EQV operator is used to perform a logical comparison on two expressions (i.e., are the two expressions identical), where the expressions are Null, or are of Boolean subtype and have a value of True or False.
The EQV operator can also be used a “bitwise operator” to make a bit-by-bit comparison of two integers. If both bits in the comparison are the same (both are 0’s or 1’s), then a 1 is returned. Otherwise, a 0 is returned.
The order of the expressions in the comparison is not important.
Example:
TRUE EQV TRUE = TRUE
And:
TRUE EQV FALSE = FALSE
MOD Function
The MOD operator divides two numbers and returns the remainder. In the example below, 5 divides into 21, 4 times with a remainder of 1.
Example:
21 MOD 5 = 1
And:
22 MOD 5 = 2