and the Microsoft), An WMLScript is the client-only scripting platform used in the
combination with the WML to provide a client side procedural logic.
A D V E R T I S E M E N T
Like an WML, WMLScript
is also compiled via the WAP gateway in a binary form to provide the intelligence to
the mobile clients.
The WMLScript Syntax
The following bullets do help to summarize the basic syntax of the language:
Smallest unit of the execution in WMLScript is the statement and each statement
should end with the semicolon (;).
An WMLScript is a case-sensitive.
The Comments can either be single-line (beginning with "//") or can be multi-line
(bracketed by" /* "and "*/"). This syntax is also identical to both languages C++ and Java.
The literal character string is defined as any sequence of zero's or can be more
characters enclosed within the double ("") or a single (‘) quotes.
The Boolean literal values correspond to either true or false.
The New variables are declared using the keyword var (i.e. var x;)
WML Data Types
Following are the data types that are supported by the WML:
WMLScript Standard Libraries
The WMLScript do provides six "pre-built" libraries. These libraries includes:
Lang - data type manipulation, the absolute value calculations, and the random
Float - this library includes the sqrt(), the round(), and the pow().
String -this library includes length(), the charAt(), the find(), the replace(),
and finally the trim() function.
URL - A typical functions include the getPath(), the getReferer(), and the getHost()
WMLBrowser - The commonly used functions in this library are next(), getCurrentCard(),
go(), prev() and the refresh() function.
Dialogs - This library contains the functions the prompt(), the confirm(), and the alert() function.