According to the Delphi documentation:
http://docwiki.embarcadero.com/RADStudio/Rio/en/Conditional_compilation_%28Delphi%29
The conditional directives {$IFDEF}, {$IFNDEF}, {$IF}, {$ELSEIF}, {$ELSE}, {$ENDIF}, and {$IFEND} allow you to compile or suppress code based on the status of a conditional symbol.
The {$IFDEF}
and {$IFNDEF}
only allow you to work with defines previously set by {$DEFINE ...}
.
However the {$IF ..}
directive is much more flexible, because:
Delphi identifiers cannot be referenced in any conditional directives other than {$IF} and {$ELSEIF}.
const LibVersion = 6; //One constant to define the libversion.
{$IF LibVersion >= 10.0}
do stuff that covers LibVersion 10,11 and 12
{$ELSEIF Libversion > 5.0}
do other stuff that covers LibVersion 6,7,8,9
{$IFEND}
If you tried to do that with defines you'd have to do
{$DEFINE Lib1}
{$DEFINE Lib2}
{$DEFINE Lib3}
{$DEFINE Lib4}
{$DEFINE Lib5}
{$DEFINE Lib6} //all previous versions have to be defined.
{$IFDEF Lib10}
do stuff that covers LibVersion 10, 11 and 12
{$ELSE}
{$IFDEF Lib6}
do stuff that covers LibVersion 6,7,8,9
{$ENDIF}
{$ENDIF}
It's just a slightly more advanced version of processing the defines.
The {$IF ..} notation is a bit more powerful and it allows you to query constant expressions and not just defines.
The {$IF ..}
directive was introduced in Delphi 6.
I guess Embarcadero decided to clean up the code base.