I have the following code (IP addresses changed) in a Delphi 7 project.
const
{$IFNDEF DEBUG}
AUTHENTICATOR_DB_ADMIN_HOST = '123.456.789.12';
{$ELSE}
AUTHENTICATOR_DB_ADMIN_HOST = '127.0.0.1';
{$ENDIF}
Under project options:
- In the "Directories/Conditionals" tab under the section marked "Conditionals", I have a single definition: "DEBUG".
- In the "Version Info" tab under the section marked "Module Attributes", I have ticked the checkbox labelled "Debug-build".
In the above code example, the "DEBUG" symbol is not defined, so the IP address is set to 123.456.789.12
instead of 127.0.0.1
. What am I doing wrong?
This question is following on from Does Delphi's conditional compilation allow the defined symbols to contain values?
{$DEFINE DEBUG}
to have it defined only in specific units – Antedate