Delphi-Quellcode:
while (p<>nil) do
begin
s:=stacktostring(p,i);
pfad:=s;
form1.kortn[i]:= TImage.Create(form1);
with form1.kortn[i] do
begin
Parent:=form1;
Left:=100+(i*30);
Top:=300;
Width:=75;
Height:=130;
Picture.LoadFromFile('C:\'+pfad+'.JPG');
knr:=strtoint(s);
Tag:=knr;
proportional:=true;
onClick:=form1.myonclick;
end;
p:=p^.next;
i:=i+1;
end;
....
procedure cleanup;
var
i : integer;
begin
for i:=0 to st-1 do
begin
form1.kortn[i].free;
end;
end;
cleanup ruf ich dann von einer anderen prozedur auf.