TOBOOLEAN

Syntax

TOBOOLEAN (expression)

Description

Converts numeric or string data to a Boolean value.

Arguments

expression The number or string value to convert. expression can be:

— Byte
— Decimal
— Double (any)
— Integer (any)
— String
— Unsigned Integer (any)

Returns

A Boolean value.

Remarks

Trying to convert DateTime or String (1) data to Boolean will result in an error.

When converting data to a Boolean value, a numeric zero (0) maps to False. All non-zero numbers, including decimals and negative numbers, map to True.

Examples

Where IsTrue is a String source field:

TOBOOLEAN (MyEntity.IsTrue)

Returns: True for any of the following values:

"true","True", or " TRUE"

Returns: False for any of the following values:

Null, " false", or "FaLsE"

Returns an error for any of the following values:

"", "Hello World", "1", "0", "truthiness"

Related Topics

Data Conversion