Autor Beitrag
Ebil
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 131



BeitragVerfasst: So 23.11.08 16:06 
Hi leute,
Ich habe eine eigene klasse erstellt:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
type
  TParticle = class(TObject)
  constructor Create(iPosX, iPosY,iSx,iSy: Integer);
  procedure paint;
  destructor Destroy;
  PosX,PosY,Sx,Sy : Integer;
  end;


im constructor hab ich dann das

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
constructor TParticle.create(iPosX, iPosY,iSx,iSy: Integer);
begin
  Inherited Create;
  PosX := 0;
...
end;


Wieso gibt es bei PosX eine zugriffsverletzung?
Hab noch nicht viel mit klassen gemacht aber das was ich mir angeschaut habe war nicht viel anders.

Ebil
Robert.Wachtel
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 895
Erhaltene Danke: 7

Windows 7 Ultimate x64
D5 Ent, D7 Arch, RAD Studio 2010 Pro, VS 2008
BeitragVerfasst: So 23.11.08 16:16 
Ich könnte wetten, dass Du die Klasse falsch erzeugst. Zeig mal den Code.
Ebil Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 131



BeitragVerfasst: So 23.11.08 16:20 
Oh mist du hattest recht.
Ich hatte einfach paricle[I].create und nicht
particle[I] := Tparticle.create...

Danke ;D

Ebil

Moderiert von user profile iconmatze: Delphi-Tags hinzugefügt
Robert.Wachtel
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 895
Erhaltene Danke: 7

Windows 7 Ultimate x64
D5 Ent, D7 Arch, RAD Studio 2010 Pro, VS 2008
BeitragVerfasst: So 23.11.08 16:22 
:mrgreen: Woher wusste ich das? :mrgreen: