Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Objekt einer Liste hinzufügen (https://www.delphipraxis.net/100521-objekt-einer-liste-hinzufuegen.html)

xZise 29. Sep 2007 13:46


Objekt einer Liste hinzufügen
 
Hallo DP,
ich möchte einer TList/TObjectList ein eigenes Objekt (TTab = class(TObject)) hinzufügen.
Das Problem ist aber dass ich dabei immer eine AV bekomme?
Delphi-Quellcode:
TTabs = class(TObject)
private
  FTabs : TObjectList;

  function GetTab(idx: Integer): TTab;
  procedure SetTab(idx: Integer; const Value: TTab);
public
  property Tab[idx : Integer] : TTab read GetTab write SetTab;

  procedure Add(const ATab : TTab);
  procedure Delete(const AIndex : Integer);

  constructor Create;
  destructor Destroy; override;
end;

procedure TTabs.Add(const ATab: TTab);
begin
  FTabs.Add(ATab);
end;

Dax 29. Sep 2007 13:48

Re: Objekt einer Liste hinzufügen
 
Wurde FTabs erstellt? Wurde dein Containerobjekt erstellt?

xZise 29. Sep 2007 14:07

Re: Objekt einer Liste hinzufügen
 
Zitat:

Zitat von Dax
Wurde dein Containerobjekt erstellt?

Nein :( Bitte nicht :wall: Warum ich :pale:

semo 29. Sep 2007 14:37

Re: Objekt einer Liste hinzufügen
 
*lol*
war doch kurz und schmerzlos die antwort/lösung ;-)


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:45 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz