WMLScript Developer's Guide

[Cover] [Previous Section] [Next Section] [Index]

Current chapter: Chapter 7 - Functions
Section 39 out of 57 total sections , Section 2 out of 3 sections in this chapter


Function Declarations

In WMLScript, function declarations include a function name with optional parameters and a block statement that is executed when the function is called.

All functions have the following characteristic:

You can use the extern keyword to make a function available to an outside file.

function currencyConverter(currency, exchangeRate) {  
    return currency*exchangeRate;  
}  
extern function testIt() {  
    var USD = 10;  
    var FIM = currencyConverter (USD, 5.3);  
}  

[Cover] [Previous Section] [Next Section] [Index]


Part Number DKDS-41-002, UP.SDK Release 4.1, December 2000

Copyright © 1994-2000 Openwave Systems Inc. All rights reserved.
Please send comments and questions to sdk-doc-comments@openwave.com.