Solly,
tut ma leid, was zimmlich verbugt. Hier die funktionierende Version:
Code:
procedure TForm1.Button1Click(Sender: TObject);
var N:integer;
var TempN:integer;
var Text:String;
begin
N := 0;
while N < listview1.items.count Do
begin
tempN := n-1;
text := '';
while tempN <> n+4 Do
begin
tempN := tempN+1;
if tempN = listview1.items.count then
begin
memo1.lines.add(text);
exit;
end;
text :=text+listview1.items.item[tempn].caption;
end;
memo1.lines.add(text);
N := tempN+1;
end;
end;
Oder (ist kürzer):
Code:
var Text:String;
var N:integer;
begin
text := '';
For N := 1 to listview1.items.count Do
begin
text := text+listview1.Items.Item[n-1].Caption;
if (N Mod 5 = 0)and(n <> 0) then
begin
memo1.Lines.Add(text);
text := '';
end;
end;
if text <> '' then
memo1.Lines.Add(text);
//end;
end;