Possible Duplicate:
How can I identify and get rid of unused units in the “uses clause” in Delphi 7?
is there a too that can check for unneeded uses units, that expand the project beyond its needs?
example we have
unit a;
uses b,c;
procedure aP;
var bI:Tb;
begin
bI := Tb.create;
bI.free;
end;
end.
where there is no use of c. c was introduced to the project, and never being used at the project.
Yes, you can use the tool in CnPack or the one in Peganza.
Beware that even if you do not refer to a symbol defined in a unit, the inclusion of that unit can have an impact on your project. Including a unit means that code in any initialization
or finalization
sections runs and that can, of course, change the meaning of your program. The canonical example of this is a replacement memory manager.
The FAQ for GExperts discusses this issue and explains why they do not offer such a facility.
精彩评论