11.3. 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.
Previous Page | Page 20 of 71 | Next Page |
- 1. WMLScript Introduction
- 2. Hello World WMLScript Example
- 3. Compiling WMLScript Code
- 4. WMLScript Language Rules
- 5. Defining WMLScript Functions
- 6. Calling WMLScript Functions
- 7. WMLScript Variables
- 8. WMLScript Data Types
- 9. WMLScript Variables Vs WML Variables
- 10. Passing Arguments to Functions By Value and By Reference
- 11. WMLScript Operators
- 12. WMLScript Conditional Statements
- 13. WMLScript Looping Statements
- 14. WMLScript Standard Libraries Overview
- 15. WMLScript WMLBrowser Standard Library
- 16. WMLScript Dialogs Standard Library
- 17. WMLScript String Standard Library
- 18. WMLScript Float Standard Library
- 19. WMLScript Lang Standard Library
- 20. WMLScript URL Standard Library
- 21. WMLScript Example: Validating Form Data