Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Boolean constants

&pagelevel(4)&pagelevel

There are two Boolean constants: TRUE and FALSE. Permissible synonyms for TRUE and FALSE are YES/NO and ON/OFF. These names are reserved names and therefore cannot be used as variable names. The table below defines the data type and shows the names that are valid for Boolean constants:

Data type

Value range

Character set

<boole-const>

TRUE, FALSE

TRUE, YES, ON, FALSE, NO, OFF

Boolean constants must not be enclosed in single quotes, since they would then be interpreted as strings.

Boolean constants can be linked to logical expressions by means of relational or logical operators.

Boolean constants are specified directly. The results returned by Boolean variables, expressions and functions are Boolean values that equal either TRUE or FALSE.

Example

/DECLARE-VARIABLE SWITCH-1(TYPE=*BOOLEAN)
/DECLARE-VARIABLE SWITCH-2(TYPE=*ANY)
/SWITCH-1 = ON     “Correct assignment”
/SWITCH-2 = 'OFF'  “Incorrect assignment”

Both assignments are syntactically correct, but only SWITCH-1 can later be inserted in a logic operation as a Boolean constant. SWITCH-2 was assigned a string, which means that it can only be inserted in relational and string operations; otherwise, SDF-P reports an incorrect data type.