WMLScript is a weakly typed language. This means you never specify the datatype of a variable or the return type of a function. All expressions have a type internally, but WMLScript itself converts values back and forth between the different types as required, so that you don’t have to.
For example, the value
1234 is an integer, but if
you pass it to the
String.length( ) library
function, which expects a string, it’s implicitly converted to
"1234", the length of which is 4.
Similarly, if you try to evaluate the expression:
"1234" * "2"
both values are converted to integers before use, and the result is
2468. This is what is meant by
WMLScript has five datatypes: string, integer,
floating-point number, Boolean, and the special type
invalid. Every value in WMLScript belongs to one
of these types, although most can be converted to others. The format
of a literal value determines its type. (A
literal is a constant included explicitly in the
Strings in WMLScript can be any sequence of Unicode characters. They may be enclosed within either single or double quotes. The type of quotes used makes no difference to the string itself.
WMLScript supports special escape sequences to include special characters in strings. This can be used for nonprinting characters (such as newlines), characters that have a special meaning in strings (such as quotes), and characters ...