Variants in Expressions All operators except ^, is, and in take variant operands. Except for comparisons, which always return a Boolean
result, any operation on a variant value returns a variant result. If an expression combines variants with statically-
typed values, the statically-typed values are automatically converted to variants.
This is not true for comparisons, where any operation on a Null variant produces a
Null
variant. For example:
V := Null + 3;
assigns a
Null
variant to
V
. By default, comparisons treat the
Null
variant as a unique value that is less than any
other value. For example:
if Null > -3 then ... else ...;
In this example, the else part of the if statement will be executed. This behavior can be changed by setting the
NullEqualityRule
and
NullMagnitudeRule
global variables.