[DUG] Usage - initialization and finalization
Karl at Work
karlreynolds at xtra.co.nz
Mon May 22 17:33:29 NZST 2006
> There is no such thing as a circular reference in Delphi. IE. The
> compiler will come up with a compiler error.
>
> What you are referring to is where one unit references another in this
> fashion.
>
> Unit UnitA
>
> Interface
> Uses UnitB
>
> Unit UnitB
>
> Implementation
> Uses
> UnitA;
>
>
> Initialization and finalization are part of the private implementation
> of a unit. Not a public part of a unit. No code in unitA interface has
> any relevance to an initialization, because there is no executing
> code.....
> UnitB is clearly saying that its executing portion requires
> information
> from UnitA. Initializations must execute in dependency order.
>
> So. What do you think the order will be?
No, please, do try to be a little more patronising why don't you? I was
referring to a circular reference between the uses clauses of units in their
respective *implementation* sections. In the words of Peter Below,
>>
You can rely on any unit in the Interface Uses clause of unit A to be
initialized
before unit A is initialized. There is no such guarantee for units named in
the
Implementation Uses clause.
<<
http://groups.google.co.nz/group/borland.public.delphi.language.delphi.gener
al/browse_frm/thread/7ee41b0debff7380/46e112c1bc57e2c5
Sure, you can log the order that your unit initializations and finalizations
are firing in easily enough. But to be able to impose an order is another
task entirely.
Cheers,
Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 2480 bytes
Desc: not available
Url : http://ns3.123.co.nz/pipermail/delphi/attachments/20060522/8d7e9ee8/winmail.bin
More information about the Delphi
mailing list