Tony,

> -----Original Message-----
> how efficient is the Delphi compiler with regarding the uses
> clause?  If you
> have several units specified, does it link them all even
> though you may not
> use any functionality out of those units?

All referenced units get compiled.  If you are creating an EXE or DLL, the
linker will optimise out code / data that is not referenced.  However, this
does not include code in initialization / finalization, plus virtual /
published methods.

If the unit is to be compiled into a package, no optimisation is done -
everything is included.

As for how efficient, you can try this test:

1.  Create a blank project, remove the main form.  In the dpr file, remove
all code that the IDE puts in.  Compile it.
2.  Now, remove the reference to the Forms unit.  Compile it.  Can you spot
the file size difference?

Don't include units that you do not intend to use.

> Next question, what is the
> minimal number of uses required to instantiate a DataModule?
> There is a
> fairly good sized list up the top there, can you trim it back at all?

TDataModule is declared in the Forms unit.  If you only want to instantiate
a particular data module that you wrote, you only need to include the unit
that the data module is declared in.

Regards,
Dennis.

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to