BDS 2006 and compiler directives separation character
Posted: (EET/GMT+2)
I today noticed a minor problem with BDS 2006: whenever you have more than one compiler directive defined, you need to pay attention to the separator character you use. Especially, if you are moving your code from an earlier version of Delphi, this issue might bite you.
The problem is that if you use Borland Developer Studio 2006 to define more than one compiler directive (for conditional compilation with $IFDEF for example) using the Project Properties window, you must use the semicolon ";" to separate your entries. However, the DCC compiler itself is happy with a comma as well, but the IDE isn't. This can lead to problems with code that actually compiles, but behaves wrong when you want for example to refactor it. If you have code within $IFDEFs, and have enabled a conditional symbol but used the comma to do so, the refactoring features believes you don't have the conditional defined, and thus leaves your $IFDEFed code intact.