>I have 2 objects, each in their own unit. Both objects refer to each other.
>To accomplish this, it seems that I have to have the other unit in the uses
>statement of the interface part. This gives a circular reference, as stated in
>the manual.
>Is there some way to accomplish what I want, without having to make one
>unit out of the 2. More exactly, If I have to put these 2 units together, I have
>to do the same with a couple of other units too. This means that 4 relatively
>large units will have to become 1.
>In order to clarify this, I have made this example;
> Unit UA;
> Interface
> Uses TB; {Gives circular reference}
> TA = class(TObject)
> ....
> public
> Property BObjects[Index : integer] : TB read getTB;
> ....
> end;
> Implementation
> .....
> end.
> Unit UB;
> Interface
> uses UA; {gives circular reference}
> {TA = class; -> try to make a forward class declaration
> -> stops at implementation part, not declared}
> TB = class(TObject)
> ....
> public
> constructor create(Owner : TA);
> ....
> end;
> Implementation
> {Uses UA -> Could hopefully be used, but has to come before declaration,
> else the object refered is unknown for the compiler}
> .....
> end.
>Putting TA = Class; in interface part of Unit UB to make a forward class
>declaration (then I could put one of the uses part in the implementation section)
>does not help, since the class has to be declared in the interface part.
>So. Is this impossible without having those mutually dependent objects in one
>unit?
>Thank you in advance, for any viewpoints of this problem.
>Alf Inge Lindtner
>a...@sn.no
>----------------------------------------------
>http://aksess-www.sn.no/~alfi/