TOLOGICAL function

TOLOGICAL(Value) TOLOGICAL(Value)

Value

Number, Logical, Text, Color, { Number }, { Logical }, { Text } or { Color }

The value to convert.

Returns

Logical or { Logical }

A logical value corresponding to the given value.

Returns the given value converted to a logical value. TOLOGICAL(1)TOLOGICAL(1) returns TRUE.

When the sole parameter is a logical value, it is returned unchanged. When it is a number, 0 is converted to FALSE and all other values are converted to TRUE. When it is a color, a fully-opaque black color is converted to FALSE and all other values are converted to TRUE. Text strings with a length of zero are converted to FALSE, and all other text strings are converted to TRUE.

This function is specific to Calcapp.

Examples

TOLOGICAL(FALSE)TOLOGICAL(FALSE)

Returns FALSE.

TOLOGICAL(TRUE)TOLOGICAL(TRUE)

Returns TRUE.

TOLOGICAL(0)TOLOGICAL(0)

Returns FALSE.

TOLOGICAL(1)TOLOGICAL(1)

Returns TRUE.

TOLOGICAL(999)TOLOGICAL(999)

Returns TRUE.

TOLOGICAL(-999)TOLOGICAL(-999)

Returns TRUE.

TOLOGICAL(Color.Black)TOLOGICAL(Color,Black)

Returns FALSE.

TOLOGICAL(Color.Red)TOLOGICAL(Color,Red)

Returns TRUE.

TOLOGICAL("")TOLOGICAL("")

Returns FALSE.

TOLOGICAL("test")TOLOGICAL("test")

Returns TRUE.