WMLScript Logical
Operators - Performing Boolean Operations
Logical
operators are used to perform Boolean operations. The NOT, AND and OR
Boolean operations are supported in WMLScript. Logical operators work
together with comparison operators, conditional operators, if
statements, while statements
or for statements
for decision-making purposes.
The
NOT operator is !. The following WMLScript example illustrates how to
use it:
x
= !true; y = !false;
After
the execution of the above script, x contains the false value and y
contains the true value.
The
AND operator is &&. The following WMLScript example
illustrates how to use it:
w
= true && true; x = true && false; y = false &&
true; z = false && false;
After
the execution of the above script, w contains the true value and x, y
and z contain the false value.
The
OR operator is ||. The following WMLScript example illustrates how to
use it:
w
= true || true; x = true || false; y = false || true; z =
false || false;
After
the execution of the above script, w, x and y contain the true value
and z contains the false value.
|
Feedback Form (ExpandCollapse)
|
|