Assigning Values with the Assignment Operators

Assignment operators are useful for setting variables to some value. In fact, you’ve already used one of these operators in previous examples in Part III: the equal sign (=).

Of course, just because the assign operator might be familiar to you, the rest of the assignment operators might not be. Table 11.1 lists the assignment operators designated in WMLScript.

Table 11.1. The WMLScript Assignment Operators
Operation WMLScript Operator
Assign. =
Add (numbers)/concatenate (strings) and assign. +=
Subtract and assign. -=
Multiply and assign. *=
Divide and assign. /=
Divide (integer division) and align. div=
Remainder or modulus and assign. The sign of the results equals the sign of the dividend.

Get WAP 2.0 Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.