LOGICAL function

Converts any data type into the LOGICAL data type.

Syntax

LOGICAL ( expression [ , char-expression-format ] )
expression
An expression in the data type that you want to convert to logical.
char-expression-format
A character expression that evaluates to a valid logical format, such as "si/no", or "da/nyet". This argument is ignored unless expression is of CHARACTER type. Also, this argument is only needed if expression evaluates to something other than the usual TRUE or FALSE, or YES or NO values.

Example

The following code fragment illustrates the Logical function:

DEFINE VARIABLE mychar AS CHARACTER NO-UNDO.
DEFINE VARIABLE v-log  AS LOGICAL   NO-UNDO.

mychar = "si".

v-log = LOGICAL(mychar, "si/no")
/* v-log is TRUE */

Notes

See also

STRING function, INTEGER function, DATE function