Delphi #IF(DEBUG) equivalent?
Is there a Delphi equivalent of the C# #if(DEBUG) compiler directive? Use this: {$IFDEF DEBUG} ... {$ENDIF} PatrickvL Apart from what lassevk said, you can also use a few other methods of compiler-evaluation (since Delphi 6, I believe) : {$IF NOT DECLARED(SOME_SYMBOL)} // Mind you : The NOT above is optional {$ELSE} {$IFEND} To check if the compiler has this feature, use : {$IFDEF CONDITIONALEXPRESSIONS} There are several uses for this. For example, you could check the version of the RTL; From the Delphi help : You can use RTLVersion in $IF expressions to test the runtime library version level