Operators (Magic xpi 4.13)
You can use Operators within your expressions. The expression can include an Operator that describes the action to perform, and an Operand, which is the object on which the action should be performed, such as the variable you included.
Operators are divided into these three categories:
You can enter any arithmetic expression that follows conventional algebraic rules, or a string or a logical expression. Here are the Operators you can use:
|
|
|
Mathematical Operators
|
+
|
A+B+C
|
Mathematical operator for addition.
|
/
|
A/B
|
The result of integer division is rounded to the nearest whole number.
|
^
|
A^B returns A to the power of B.
|
Mathematical operator for exponentiation.
|
*
|
A*B
|
Mathematical operator for multiplication.
|
-
|
A-B-C
|
Mathematical operator for subtraction.
|
String Operators
|
&
|
'John'&'Smith' yields 'JohnSmith'
|
Use the & symbol to concatenate (string together) Alpha strings.
|
Logical Operators
* All expressions involving logical operators return a logical TRUE or FALSE.
|
AND
|
|
Returns TRUE only if both operands are TRUE.
|
NOT
|
NOT ('FALSE'LOG) returns TRUE
NOT (A) Logical returns TRUE
|
Reverses the logical value of its operand.
Since Magic xpi 4.5, the NOT operator requires parentheses. When you run the Checker on a project, parentheses are added to NOT expressions. However, the parenthesis will be seen only when you open the Expression Editor after the Checker process and when you make a change to the expression or click the Verify or OK button.
|
OR
|
|
Returns TRUE only if either operand is TRUE.
|
<>
|
A<>B
|
Different than (not equal to).
|
=
|
A=B
|
Equal to.
|
>
|
A>B
|
Greater than.
|
>=
|
A>=B
|
Greater than or equal to.
|
<
|
A<B
|
Less than.
|
<=
|
A<=B
|
Less than or equal to.
|