Siebel eScript Language Reference > Methods Reference > Conversion Methods >

Convert Value to Boolean Method


The Convert Value to Boolean method converts a value to the Boolean data type. It returns a value that depends on the data type of the value that the value argument contains. This method is unique to Siebel eScript. For more information, see Make Sure the JavaScript Interpreter Can Run a Function.

Format

ToBoolean(value)

Table 91 describes the arguments for the Convert Value to Boolean method.

Table 91. Arguments for the Convert Value to Boolean Method
Argument
Description

value

The value that this method converts to a Boolean value.

Values That the Convert Value to Boolean Method Returns

Table 92 describes the values that the Convert Value to Boolean method returns.

Table 92. Values That the Convert Value to Boolean Method Returns
Data Type
Return Value

Boolean

Value that the value argument contains.

buffer

This method returns one of the following values depending on if the buffer is empty:

  • Buffer is empty. It returns false.
  • Buffer is not empty. It returns true.

null

False

number

This method returns one of the following values:

  • If the value that the value argument contains is one of the following, then it returns false:
    • 0
    • +0
    • -0
    • NaN
  • If the value that the value argument contains is not 0, +0, -0, or NaN, then it returns false.

For more information, see NaN Numbers.

object

True

string

This method returns one of the following values depending on if the string is empty:

  • The string is empty. It returns false.
  • The string is not empty. It returns true.

undefined

False

Siebel eScript Language Reference Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.