WMLScript Developer's Guide

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

Current chapter: Chapter 3 - Essential Language Elements
Section 18 out of 57 total sections , Section 5 out of 6 sections in this chapter


Data Types

Data types define the type of data a variable can hold. WMLScript is a weakly-typed language that supports data types internally only. As a result, you do not have to specify the variable type and any variable can contain any type of data at any given time. WMLScript automatically converts between the various data types as needed.

Examples of data types include:

In addition to the four standard data types, WMLScript uses a fifth data type, invalid, when a data type needs to be differentiated from the other internal data types.

This section describes the limitations and uses of the following WMLScript data types:



Integer

WMLScript supports integer values in the range -2147483648 to 2147483647. You can use Lang library functions to retrieve these values at run time:



Floating-Point

WMLScript supports a maximum floating-point value of 3.40282347E+38. The minimum positive nonzero value (at least the normalized precision must be supported) is 1.17549435E-38 or smaller.

WMLScript handles the special floating-point number types using the following rules:

You can use the Float library functions to get the maximum and minimum values at run time:



String

String variables are temporary combinations of letters, digits, or special characters. You can use string literals to initialize string variables. You can manipulate string values with the WMLScript operators and the functions specified in the standard String library.

Examples of String variables include:



Boolean

You can use Boolean values to initialize or assign a value to a variable and in statements that require a Boolean value as one of the parameters. Boolean values can be a literal or the result of a logical expression evaluation.

Examples of Boolean variables include:


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