Using Functions in WMLScript

Functions are a named portion of a program that performs a specific task. In other words, functions are a type of procedure or routine.

Most programming languages come with a prewritten (or built-in) set of functions that are kept in libraries. WMLScript is no exception. You’ll learn more about WMLScript’s libraries and built-in functions in Chapter 12, “Working with WMLScript Libraries.”

In addition, developers can write their own functions to perform specialized tasks.

You might not have realized it, but you used both built-in and user-created functions in your validate2.wmls file. Let’s look at this code again. The bold areas of this code represent the different function names you used:

extern function checkpass ...

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.