WMLScript » Functions » Lang

The Lang Library contains fifteen functions. You can use these various functions to perform operations on integer and floating-point numbers, create random numbers, create absolute values, stop the current code execution, and determine support parameters.

The optional Float Library contains eight functions that perform related tasks on floating-point numbers.

The library and function names are case sensitive.

Lang.abort

Syntax: Lang.abort(errorDescription)

Aborts the current code and returns control to the caller.

Lang.abs

Syntax: Lang.abs(value)

Returns the absolute value.

Lang.characterSet

Syntax: Lang.characterSet()

Returns the character set being supported.

Lang.exit

Syntax: Lang.exit(value)

Ends the current code and returns control to the caller.

Lang.float

Syntax: Lang.float()

Determines if floating-point numeration is supported.

Lang.isFloat

Syntax: Lang.isFloat(value)

Determines if a value can be converted to a floating-point.

Lang.isInt

Syntax: Lang.isInt(value)

Determines if a value can be converted to an integer.

Lang.max

Syntax: Lang.max(value1, value2)

Returns the maximum of two numbers.

Lang.maxInt

Syntax: Lang.maxInt()

Returns the maximum recognized integer value.

Lang.min

Syntax: Lang.min(value1, value2)

Returns the minimum of two numbers.

Lang.minInt

Syntax: Lang.minInt

Returns the minimum recognized integer value.

Lang.parseFloat

Syntax: Lang.parseFloat(value)

Converts a string into a floating-point number.

Lang.parseInt

Syntax: Lang.parseInt(value)

Converts a string into an integer.

Lang.random

Syntax: Lang.random(value)

Returns a random positive integer.

Lang.seed

Syntax: Lang.seed(value)

Initializes a pseudo-random number sequence.

See Also: