Board index » delphi » TList: cherche documentation

TList: cherche documentation

Je cherche des exemples d'utilisation de l'objet TList...
(ventuellement des rferences d'ouvrages traitant du sujet)...
jeanmarc.soliv...@hol.fr
Merci...
 

Re:TList: cherche documentation


In article <6ttsb4$p7...@news3.isdnet.net>,
  "chemis" <he...@hol.fr> wrote:

Quote
> Je cherche des exemples d'utilisation de l'objet TList...
> (ventuellement des rferences d'ouvrages traitant du sujet)...
> jeanmarc.soliv...@hol.fr
> Merci...

       At last, a foreign-language question that I think I
understand.

       TList is quite well covered in the documentation that
comes with Delphi. If you want more you can find a whole chapter
on TList in Lischner "Secrets of Delphi 2", if you can find a copy.

        A silly but complete example (typed on the fly so
there may be syntax errors):

var l: TList; b: TBitmap; j: integer;
begin
  l:= TList.Create;
  b:= TBitmap.Create;
  l.Add(b);
  b:= TBitmap.Create;
  l.Add(b);
//you can do this more concisely, the verbose
//version is for illustration

  for j:=0 to l.Count - 1 do
   begin
     b:= TBitmap(l[j]);
     b.DoSomething;
   end;

  for j:=0 to l.Count - 1 do
     l[j].Free;
  l.Free;
end;

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

Other Threads