The Syntax of Built-In Functions

Before learning about the individual WMLScript libraries, let’s first look at the syntax rules required for built-in functions. As you can see, no matter what you do, you just can’t get away from rules in this world!

To understand the syntax of built-in functions, let’s look at an example of one. This built-in function first appeared in Chapter 10, “Variables and Functions”:

Dialogs.alert("You have entered an incorrect username format.") 

Notice that the keyword Dialogs begins the function by stating from which library the function comes (in this case, the Dialogs Library).

Following the keyword Dialogs is a dot separator (.) and then the name of one of the library’s built-in functions (in this case, the alert ...

Get WAP 2.0 Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.