Board index » delphi » Need utility to remove un-used units

Need utility to remove un-used units

Is there a utility to run on a Delphi 3 projects source files to remove
the reference of a unit that is no longer needed in a PAS file ?

Problem occurs when I drop a component on a form for use or testing then
later delete that component from the form the reference to the file in
the USES clause is not removed.

I understand why it is not removed but when I need to transfer this
project to another developer, if that developer does not have the
components installed that this project states that it needs, he gets
error messages trying to load the project even though they are not
really needed.

So if there is a utility to scan the source files of a project to detect
these erroneous references it would be helpful.

Thanks
Steve

 

Re:Need utility to remove un-used units


  Just delete all of the units listed in the 'Uses clause'.  Save, and start
adding units as it's needed....

  Now, unless there is code called directly from that unit, Delphi doesn't
compile the unit into the code (even tho it's declared...)

--
Jason Wallace
SL Software
Dark...@SLSoftware.reno.nv.us
--
"We are Microsoft.  Resistance is Futile.   You will be Assimilated."
--

Quote
info wrote in message <358187DC.B66E4...@yahoo.com>...
>Is there a utility to run on a Delphi 3 projects source files to remove
>the reference of a unit that is no longer needed in a PAS file ?

>Problem occurs when I drop a component on a form for use or testing then
>later delete that component from the form the reference to the file in
>the USES clause is not removed.

>I understand why it is not removed but when I need to transfer this
>project to another developer, if that developer does not have the
>components installed that this project states that it needs, he gets
>error messages trying to load the project even though they are not
>really needed.

>So if there is a utility to scan the source files of a project to detect
>these erroneous references it would be helpful.

>Thanks
>Steve

Other Threads