Siebel eScript Language Reference > Siebel eScript Commands > The Global Object >

ToBoolean() Method


This method converts a value to the Boolean data type.

Syntax

ToBoolean(value)

Parameter
Description
value
The value to be converted to a Boolean value

Returns

A value that depends on value's original data type, according to the following table:

Data Type
Returns
Boolean
value
buffer
False if an empty buffer; otherwise, true
null
False
number
False if value is 0, +0, -0, or NaN; otherwise, true
object
True
string
False if an empty string, ""; otherwise, true
undefined
False

Usage

This method converts value to the Boolean data type. The result depends on the original data type of value.

CAUTION:  The ToBoolean() function is unique to Siebel eScript. Avoid using it in a script that may be used with a JavaScript interpreter that does not support it.

See Also

ToBuffer() Method, ToObject() Method, and ToString() Method


 Siebel eScript Language Reference 
 Published: 18 April 2003