Hi folks.
I am having a little problem with 'FindComponent' in Lazarus.
Here is my code:
The Code with FindComponent:
TPlayer:Code:TPlayer(FindComponent('Player' + IntToStr(Player))).
TRessourcen:Code:TPlayer = class(TObject) public Ressourcen: TRessourcen; MainBuilding: TPoint; end;
When i use this code, i get an aces violation. I use Lazarus v. 0.9.28.2 beta and windows XP. And while compiling i get the warning "unit1.pas(425,15) Warning: Class types "TComponent" and "TPlayer" are not related".Code:TRessourcen = class(TObject) public //Nahrung. Korn: integer; //Ressourcen. Holz: integer; end;
I think it my be because TObject isnt a Component, so is there some similar procedure like FindComponent for Objects
Thnx for any help.




Reply With Quote




