Registriert seit: 18. Aug 2004
Ort: Edewecht
712 Beiträge
Delphi 5 Professional
|
Re: Index von TStringDynArray auswählen
10. Nov 2004, 00:01
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
StrArry: TStringDynArray;
I: Integer;
begin
// Anstatt von Explode
SetLength(StrArry, 12);
StrArry[0] := 'Datum1'; StrArry[1] := 'Zeit1'; StrArry[2] := 'Person1'; StrArry[3] := 'Wert1';
StrArry[4] := 'Datum2'; StrArry[5] := 'Zeit2'; StrArry[6] := 'Person2'; StrArry[7] := 'Wert2';
StrArry[8] := 'Datum3'; StrArry[9] := 'Zeit3'; StrArry[10] := 'Person3'; StrArry[11] := 'Wert3';
// ---
I := 0;
while I < High(StrArry) do
begin
with ListView1.Items.Add do
begin
Caption := StrArry[I];
SubItems.Add(StrArry[I + 1]);
SubItems.Add(StrArry[I + 2]);
SubItems.Add(StrArry[I + 3]);
end;
Inc(I, 4);
end;
end;
Ciao, Sprint.
"I don't know what I am doing, but I am sure I am having fun!"
|