开发者

delphi 7. How to check whether the unit file exists and add it with (directives?) to compile with the project

I have a unit which is the part of several modules(dll, applications).

In some of them I need to use in that module their classes.

Is it possible to use compiler directives (o开发者_如何转开发r other methods) to include the unit to the file in case it is included in the project?

Thanks!


If I understood you correctly, the answer is yes. You can use a conditional define in the uses clause:

uses
{$IFDEF USE_MYSTUFF}
  MyUnit,
{$ENDIF}
  Classes, Windows;

and then define (or not) a conditional define USE_MYSTUFF in the project options.

See also $IFDEF, $DEFINE and $INCLUDE directives and Conditional Compilation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜