O'Reilly logo

Learning WML, and WMLScript by Martin Frost

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Function Calls

Function calls in WMLScript look just like they do in C or Java:

            function-name (argument-list)

The number of arguments supplied to the function must match the number of arguments in its declaration. The arguments can be any expressions, but if any of them contain the , operator, that whole argument must be enclosed in parentheses. (Otherwise, there would be ambiguity as to whether it was the , operator or just a comma separating two arguments.) For example:

factorial (5)
foo ( )
function_with_lots_of_arguments (1, 2, 3, 4, 5, 6, 7, 8, 9)

Note that this form of function call works only for calls within the same file. Calls to functions in other files use an extended syntax.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required