Siebel eScript Language Reference > Siebel eScript Commands > Conversion Methods >
ToBoolean() Method
This method converts a value to the Boolean data type. Syntax
ToBoolean(value)
|
|
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.
|
|
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. Before using it, confirm that the JavaScript interpreter that will run the script supports Siebel eScript functions. Avoid using this function in a script that may be used with a JavaScript interpreter that does not support it.
See Also
ToBuffer() Method ToObject() Method ToString() Method
|