WMLScript Developer's Guide

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

Current chapter: Chapter 6 - Statements
Section 31 out of 57 total sections , Section 5 out of 11 sections in this chapter


If Statements

An if statement defines a condition and one or two statements that are executed depending on the Boolean value of the condition. The first statement is executed if the specified condition is true; if the condition is false or invalid, the second (optional) statement is executed. The statements can be any WMLScript statements, including other nested if statements.

The following is an example of an if statement:

if (sunShines) {  
    myDay = "Good"  
    goodDays++;  
} else  
    myDay = "Oh well...";  

[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.