User Guide
29
|| (logical OR) Operator (logical); evaluates expression1 and, if
expression1 is false, evaluates expression2. The result is
(true) if either or both expressions evaluate to true; the
result is (false) only if both expressions evaluate to false.
The following example uses the || operator in an if
statement. The second expression evaluates to true so
the final result is true:
x = 10;
y = 250;
if (x > 25 || y > 200) {
z = 5;
}
else {
z=0;
}
// z has a value of 5 after the code above has executed
Fully supported
! (logical not) Operator (logical); inverts the Boolean value of a variable
or expression.
Fully supported
&& (logical AND) Operator (logical); evaluates expression1 and, if
expression1 is true, evaluates expression2. The result is
(true) if both expressions evaluate to true; the result is
(false) if either expression evaluates to false.
The following example uses the && operator in an if
statement. Both expressions evaluate to true, so the final
result is true:
x = 30;
y = 250;
if ( x > 25 && y > 200) {
z = 5;
}
else {
z = 0;
}
// z has a value of 5 after the code above has executed
Fully supported
?: (conditional) Operator (conditional); evaluates expression1, and
returns the value of expression2 if expression1 is true;
otherwise, returns the value of expression3.
The following statement assigns the value of variable x to
variable z because expression1 evaluates to true:
x = 5;
y = 10;
z = (x < 6) ? x : y;
// z has a value of 5
Fully supported
Action Name Description Support