Page 169 - DCAP512_WAP_AND_WML
P. 169
Unit 11: Using WML Script
WMLScript Operators: The four categories of operators used in WML Script which are Notes
assignment, arithmetic, comparison and logical.
WMLScript Reserved Words: They are words reserved and which cannot be used for other
naming purposes in WML Script.
WMLScript Standard Libraries: The standard libraries include script libraries, dialog libraries,
float libraries, string libraries, WML browser library, lang library, url library.
WMLScript Variables: They are variables for WML Script functions which are weakly typed,
must be declared, have a local scope, must be one of these data types which are Boolean, Integer,
Invalid, Float.
WMLScript: WML uses WMLScript to run simple code on the client.
11.8 Review Questions
1. Scripting adds “behavioral” capabilities to the device to enhance application performances
and the user experience. Discuss.
2. WML uses WMLScript which is a lightweight JavaScript language to run simple code on
the client. Explain.
3. Explain how a scripting language is similar to a programming language, but is of lighter
weight?
4. Explain the syntax of function using an example of a function.
5. Substantiate what are variables for WMLScript function? What data types can the variables
be?
6. Explain what is Reserved words? Name the reserved words in WMPScript with examples.
7. A string can contain elements separated by a specified separator. Discuss.
8. Pragmas are specified at the beginning of the compilation unit before any function
declaration. Comment.
9. Block is the body of the function that is executed when the function is called, Explain with
the suitable examples.
10. External functions can be called from outside the compilation unit in which they are
defined. Explain.
Answers: Self Assessment
1. WML pages 2. WAP structure
3. unique 4. arguments
5. parameters 6. WMLScript
7. client-side scripting 8. validate
9. WML markup 10. Identifier
11. Extern 12. Pragmas
13. Strings 14. confirm()
15. Elements()
LOVELY PROFESSIONAL UNIVERSITY 163