Is it possible to define {$IFDEF} for more than one directive at once?

Martin Reiner picture Martin Reiner · Jan 4, 2012 · Viewed 16.6k times · Source

Is it possible to define more than one conditional in one {$IFDEF} directive ?
I would like to have syntax like this:

{$IFDEF Condition1 OR Condition2} DoSomething; {$ENDIF}
{$IFDEF Condition1 AND Condition2} DoSomethingElse; {$ENDIF}

Thanks

Answer

David Heffernan picture David Heffernan · Jan 4, 2012

You would need to use $IF instead:

{$IF Defined(Condition1) or Defined(Condition2)}
DoSomething;
{$IFEND}