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)

The following table describes the 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

The following table describes the 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