delphi – Is it possible to define {$IFDEF} for more than one directive at once? – Stack Overflow
Posted by jpluimers on 2021/06/24
[WayBack] delphi – Is it possible to define {$IFDEF} for more than one directive at once? – Stack Overflow:
- use the
{$IF Defined(xxx)}
directive which allows boolean expressions like:{$IF Defined(xxx) OR Defined(yyy)}
{$IF Defined(xxx) AND Defined(yyy)}
{$IF NOT Defined(zzz)}
- it has been in Delphi since Delphi 6 (see [WayBack] conditional statements – Why {$IFDEF MSWINDOWS} is replaced with {$IF defined(MSWINDOWS)} in Delphi XE5? – Stack Overflow and many other references).
- [WayBack] IF directive (Delphi)
TypeConditional compilationSyntax{$IFexpression
}Compiles the Delphi source code that follows it if expression is true.
expression
must conform to Delphi syntax and return aBoolean
value; it may contain declared constants, constant expressions, and the functionsDefined
andDeclared
.
–jeroen
Leave a comment