1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| procedure TForm1.Button1Click(Sender: TObject);
var
i, k: integer;
SLL: array of TStringList;
MoveCount: integer;
SL1: TStringList;
begin
SL1 := TStringList.Create;
SL1.Assign(ListBox1.Items);
MoveCount := (SL1.Count div SpinEdit1.Value);
SetLength(SLL, SpinEdit1.Value);
SLL[0] := SL1;
for k := 1 to SpinEdit1.Value - 1 do
begin
SLL[k] := TStringList.Create();
for i := SL1.Count - ((k - 1) * MoveCount) - 1 downto SL1.Count -
(k * MoveCount) do
begin
SLL[k].Insert(0, SL1[i]);
SL1.Delete(i);
ShowMessage(SLL[k].Text);
end;
end;
end; |
Partager