开发者

Delphi 2006 possibility to display warnings for unused constants

Is there a possibility to make Delphi compiler display a warning for each constant that is defined but not used?

I am currently using Delphi 2006 and have several units full of resourcestrings, which are used throughou开发者_C百科t the project, and since the project is quite old, most of them aren't used anymore, although they remain in the units.

Alternatively I'm looking for a way to indicate such constants.


Delphi has no features in the program that warn or indicate constants that are not used. It can do unused local variables or unused private fields, but not unused constants.

You need to look at one of the 3rd party static code analysis tools, e.g. Peganza Pascal Analyzer. However, I would not be surprised if there were no tools that reported what you want.


The easiest way might be to comment out the resource strings, and then uncomment just those that are needed to make the code compile.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜