Flash Lite 1.x ActionScript Language Reference |
|
|
|
| Flash Lite Operators > || (logical OR) | |||
Flash Lite 1.0.
expression1 || expression2
expression1, expression2 Boolean values or expressions that convert to Boolean values.
Operator (logical); evaluates expression1 and expression2. The result is true if either or both expressions evaluate to true; the result is false only if both expressions evaluate to false. You can use the logical OR operator with any number of operands; if any operand evaluates to true, the result is true.
With non-Boolean expressions, the logical OR operator causes Flash Lite to evaluate the expression on the left; if it can be converted to true, the result is true. Otherwise, it evaluates the expression on the right, and the result is the value of that expression.
Usage 1: The following example uses the || operator in an if statement. The second expression evaluates to true, so the final result is true:
theMinimum = 10;
theMaximum = 250;
start = false;
if (theMinimum > 25 || theMaximum > 200 || start){
trace("the logical OR test passed");
}
|
|
|
|