views:

356

answers:

2

Does anyone know of a utility that can will automatically detect/remove unrequired units from the uses clause?

Preferably it can be run againt a unit and/or a project.

Preferably free and works with Delphi 2010.

Thanks in advance.

+10  A: 

Try using the "Uses Unit Cleaner" Wizard from CnPack you can download from here

alt text

Another option is use ICARUS.

ICARUS is a small subset of Pascal Analyzer. It parses Delphi or Borland Pascal source code and generates a list of unneeded unit references in your uses lists

alt text

RRUZ
Thanks, these both look very promising.Sidebar: It never ceases to amaze me how I've managed to miss little nuggets, like these... after using Delphi for more than a decade!
rhazell
+3  A: 

ICARUS from Peganza does something similar.

Uwe Raabe