Page 168 - DCAP512_WAP_AND_WML
P. 168

WAP & WML




                    Notes             WML Script follows syntax rules  which are script is case sensitive, white space is ignored,
                                       blocks are enclosed in brackets “{}”, semicolons mark the ends of statements, comments
                                       are marked with “//”.
                                      An “executable” file in WML Script is called a function. A WMLScript function is a named
                                       part of the WMLScript compilation unit that  you can call to  perform a specific set of
                                       statements and to return a value.
                                      You can use the function declaration to declare a WMLScript function name (Identifier)
                                       with the optional parameters (FormalParameterList) and a block statement that is executed
                                       when the function is called.

                                      In the syntax of function the optional extern keyword is used to specify that a function is to
                                       be externally accessible. External functions can be called from outside the compilation
                                       unit in which they are defined. Identifier is the name specified for the function. The optional
                                       FormalParameterList is a list of argument names separated by commas.
                                      Block is the body  of the function that is executed when the function is  called and the
                                       parameters have been initialized by the passed arguments.
                                      Variables for WML Script functions are weakly typed, must  be declared, have a  local
                                       scope, must be one of these data types which are Boolean, Integer, Invalid, Float.

                                      The following words are reserved words and cannot be used for other naming purposes in
                                       WML Script. They are Access, Agent, Break, Continue, Div, Domain, Else, Equiv, Extern,
                                       Forfunction, Header, http, if, Isvalid, Meta, Name, Path, Return, Typeof, url, Use, User,
                                       Var, While, String.
                                      The four categories of operators used in WML Script are assignment, arithmetic, comparison
                                       and logical.
                                      WMLScript does not support arrays as such. However, the standard String library supports
                                       functions by which array-like behavior can be implemented using strings.
                                      WMLScript supports the use of pragmas that specify compilation unit level information.
                                       Pragmas  are specified  at  the beginning  of  the  compilation unit before any  function
                                       declaration. All pragmas start with the keyword use and are followed by pragma-specific
                                       attributes.

                                      The  standard libraries include script  libraries, dialog  libraries, float libraries,  string
                                       libraries, WML browser library, lang library, url library.

                                   11.7 Keywords

                                   ECMAScript: European Computer Manufacturers Association Script

                                   Pragmas: WMLScript supports the use of pragmas that specify compilation unit level information.
                                   Scripting: Scripting  adds  “behavioral”  capabilities  to  the  device  to  enhance  application
                                   performances and the user experience

                                   WML Script: WML Script is a light JavaScript language.
                                   WML: Wireless Markup Language
                                   WMLScript Arrays: The standard String library supports functions by which array-like behavior
                                   can be implemented using strings.
                                   WMLScript Function: An “executable” file in WML Script is called a function





          162                               LOVELY PROFESSIONAL UNIVERSITY
   163   164   165   166   167   168   169   170   171   172   173