Wie kann man ein Array leeren?
Deklaration:
Labels: Array [0 .. 100] of TLabel;
Mein Versuch
Delphi-Quellcode:
zahl3 := 0;
while zahl3 <= 100 do
begin
If Assigned(Labels[zahl3]) then FreeAndNil(Labels[zahl3]);
zahl3 := zahl3 + 1;
end;
Aber nicht alle Labels sind mit Inhalt gefüllt.
Delphi-Quellcode:
Labels[zahl] := TLabel.Create(Form1);
Labels[zahl].Parent := panels[zahl];
Labels[zahl].Font.Name := 'Bauhaus';
Labels[zahl].Font.Size := 12;
Labels[zahl].Caption := '-Nicht verfügbar-';
Labels[zahl].Top := 8;
Labels[zahl].Left := 250;
Labels[zahl].OnMouseEnter := Form1.PanelsOver;
Labels[zahl].OnMouseLeave := Form1.PanelsLeave;
Labels[zahl].Tag := zahl;
Es gibt leider eine Fehlermeldung.
Was mache ich falsch oder gibt es eine andere Lösung.