Definition of True and False
A predicate expression is an expression that is evaluated as being "true" or "false" as part of a statement that controls program execution. IDL evaluates predicate expressions in the following contexts:
The definition of true and false for the different data types is as follows:
If the LOGICAL_PREDICATE compile option is set:
|
Data Type
|
True
|
False
|
|---|---|---|
| Numerical values |
Non-zero values |
Zero |
| String or heap variables |
Non-null values |
Null values |
See "COMPILE_OPT" (IDL Reference Guide) for additional details on the LOGICAL_PREDICATE compilation option.
In the following example, the logical statement for the condition is a conjunction of two conditions:
If both conditions (LON being larger than –40 and less than or equal to –20) are true, the statement following the THEN is executed.