Where do I define symbols tested with {$IFDEF}?

前端 未结 5 1334
半阙折子戏
半阙折子戏 2021-02-20 00:52

When I use Delphi directives in code, like:

{$IFDEF something}
.
.
.
{$ENDIF}

Where do I assign the word \'something\' in the project? I tried

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-20 01:37

    You can also define them in {$DEFINE } directives. What changes is the scope. When you define a under conditional defines in the project options, the scope is global to the whole project. $DEFINE directives are valid only from the point they are declared to the end of the current module, or until an $UNDEF directive using the same is encountered. What to use depends on your needs, and what the IFDEF does.

提交回复
热议问题