Autor Beitrag
MarkusD
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Mo 29.01.07 20:45 
Hi,
also ich habe folgenden Code:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
type



THut = class
      private
        FFarbe: TColor;
        FFeld: TFeld;
      procedure SetFarbe(Farbe:TColor);
      public
      property
        Feld: TFeld read FFeld;
      property
        Farbe: TColor read FFarbe write SetFarbe;
    end;

TSpieler = class(TObject)

        private
          FCol: TColor;

        public

          Hut_1: THut;
          Hut_2: THut;
          Hut_3: THut;
          Hut_4: THut;
          property Color: TColor read FCol;
          constructor create(col:TColor);

end;

TFeld = Class(TObject)
  private
    Fhut: THut;
    procedure Sethut(sHut: THut=nil);
  public
    img: TImage;

    property Hut: THut read FHut write SetHut;
    constructor create(imag: TImage);
    procedure SetFeld(sHut: Thut = nil);

end;

Da kommt natürlich immer der Error undefinierter Bezeichner, da jede von den obigen Klassen ein Objekt von den anderen brauch.
Kann man das irgendwie umgehen?
Danke im voraus,

Markus

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 29.01.07 21:05 
Dieses Problem kann man mit Hilfe einer forward-Deklaration umgehen.

_________________
Markus Kinzler.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 29.01.07 21:09 
Das Problem hatte ich gestern auch :lol: Die Lösung ist hier.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
MarkusD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Di 30.01.07 19:23 
Dankeschön