I'm also posting this message on the beginners messageboard, though I'm already quite familiar with Delphi. However, the problem described below might be a beginner's problem.
I have a problem writing OO-code in Delphi. How can I use classes which are defined later in the code? Here is an example, what my problem looks like (abstract example):
TObj1 = class
field : TObj2;
TObj2 = class
field : TObj1;
As you can see, changing the order of the declaration will not solve the problem. I was used from writing OO-code in Pascal, that you (normaly) use pointers to objects instead of object vars:
PObj1 = ^TObj1;
PObj2 = ^TObj2;
TObj1 = object
field : PObj2;
TObj2 = object
field : PObj1;
But since Delphi replaces the need to use pointers to objects simply by using classes (as I mentioned in Delphi, var a : TObject; is actually a pointer to an instance of (an inheritor of) TObject), this doesn't look to be the right way.
Please help me - is there any possibility to declare classes "forward"? Or any other way to do this?