They are a fact of life, and usually only because you want things in
different units, else if all in one unit, then no problems.
Its a pity we can't forward declare a class type, that is later defined in
another unit, as this would get around the problem nicely - it would then
need to appear in the implementation "uses" section.
The Circular reference problem usually stems more from the desired
design/architecture and the want to have compiler type checking active.
The only "general" current solution for Delphi, is as suggested, to define a
base/root class and then inherit use this where required and then typecast
to the actual class.
Myles.
> -----Original Message-----
> From: Kerry Sainsbury [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, August 19, 1999 9:05 AM
> To: Multiple recipients of list delphi
> Subject: Re: [DUG]: Circular unit references - gotta love'm!
>
> --- Nahum Wild <[EMAIL PROTECTED]> wrote:
> > Does anyone know how to get around the following issue where I have
> > two
> > different classes that each contain a reference to the other in their
> > definition, the problem being that I want them in different units.
> > As
> > predicted delphi spits a 'circular reference' error at me. :s(
>
> My honest answer would be to suggest that you shouldn't write code like
> that :-) You don't want to create such dependencys between your classes
> -- it makes reuse too tricky.
>
> What's your real-world example? Perhaps we can think of a more elegant
> solution to the problem.
>
>
> ===
> Cheers,
> Kerry S
> -- Systems Engineer, Inprise NZ. [EMAIL PROTECTED]
> _______________________________________________________________
> DO YOU YAHOO!?
> Get your free @yahoo.com.au address at http://mail.yahoo.com.au
>
> --------------------------------------------------------------------------
> -
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz