Thema: Delphi Echter Objektcontainer?

Einzelnen Beitrag anzeigen

Tyrael Y.

Registriert seit: 28. Jul 2003
Ort: Stuttgart
1.093 Beiträge
 
Delphi 2007 Professional
 
#5

Re: Echter Objektcontainer?

  Alt 8. Aug 2005, 16:18
Delphi-Quellcode:
  myObjectList := TObjectList.Create(False);
  ..
  .
  .
  AObject := TMyObject.Create();
  .
  .
  myObjectList.Add(AObject);




..
...
...
  TMyObject(myObjectList.Items(Index)).MachWas;
  TMyObject(myObjectList.Items(Index)).NeProperty := 45678;
  TMyObject(myObjectList.Items(Index)).NeAndereProperty := 'Hallo Welt';
....
...
....
...

 for i := myObjectList.Count - 1 DownTo 0 do
 begin
   TMyObject(myObjectList.Items[i]).Free;
   myObjectList.Items[i].Delete;
 end;
...
...
..
..

  myObjectList.Free;

alles Wichtige steht im oberen Beispielcode...weitere Infos in der Hilfe unter
TObjectList


Gruß

Tyrael
Levent Yildirim
Erzeugung von Icons aus Bildern:IconLev
  Mit Zitat antworten Zitat