WMLScript Logical Operators - Performing Boolean Operations

Preferences - Do not show ads

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

Contents at a Glance
Print this Web Page | | Back to Top

Feedback Form (Expand)

What do you think about this web page?






WMLScript Tutorial Table of Contents WMLScript Tutorial Contents at a Glance Preferences - Change Color Scheme Preferences - Do Not Show Ads Previous Page Next Page