The WMLScript is weakly typed language. This means that there is no type-checking at
the compile- or the run-time and no variable types are been declared explicitly .
Internally, these data types are supported by the WML:
Boolean.
Integer
Floating-point
String
Invalid
The programmer need not specify the type of any variable; The WMLScript will
automatically attempt to convert between different types as and when needed. the
other point to note here is that the WMLScript is not an object-oriented (like Java
or C++). Therefore, it is impossible to create our own data types (user-defined
data types) programmatically.
WML Operators
The WMLScript supports the variety of operators that do support the value assignment
operations, the arithmetic operations, lthe ogical operations, the string operations,
the comparison operations, and finally the array operations.
The Flow Control Statements
The operators and the expressions supported by an WMLScript are identical
virtually to those of a JavaScript programming the language so they are not discussed
here. Java do support the number of control statements for handling the
branching within the programs. These includes the if-else statement, for loop
statement, while loop statement, break statement, and the continue statements.
The if Statement
if (x == y)
{
x = x * 3.25;
}
else
{
x = 0;
}
The for Statement
for (var counter = 1; counter < 500; counter ++)
{
var i = counter * 1.05;
somefunction(i);
};
The while Statement
var i=50;
var j=0;
while (i > j)
{
i--;
};
The continue Statement
for (var counter = -100; counter < 100; counter ++)
{
if (counter == 0) continue;
var x = 350/counter;
};
Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
Keywords: language elements, tag elements, document elements, dynamic elements,is elements,
object elements, type elements, input elements, form elements, header elements,
elements 2.0