procedure TForm3.Button1Click(Sender: TObject);
var
i,j: integer;
begin
with StringGrid1 do
begin
for j:=2 to RowCount-1 do
begin
for i:=1 to RowCount-j do
begin
if Cells[0,i]>Cells[0,i+1] then
begin
Rows[RowCount+1]:=Rows[i+1];
Rows[i+1]:=Rows[i];
Rows[i]:=Rows[RowCount+1];
end;
end;
end;
end;
end;
end.
Сортировка StringGrid'а |