Информатика. Программирование в Delphi
293
Form1: TForm1;
currdir:string;
currfile:string;
implementation
{$R *.dfm}
procedure sort;
var
i,j,k:integer;
s:string;
old,new:string;
begin
with Form1.StringGrid1 do
if RowCount>2 then
begin
old:='';
for i:=0 to ColCount-1 do
old:=old+Cells[i,row];
for i:=1 to RowCount do
for j:=1 to RowCount-2 do
if Cells[0,j]>Cells[0,j+1] then
for k:=0 to ColCount-1 do
begin
s:=Cells[k,j];
Cells[k,j]:=Cells[k,j+1];
Cells[k,j+1]:=s;
end;
for i:=1 to RowCount-1 do
begin
new:='';
for j:=0 to ColCount-1 do
new:=new+Cells[j,i];
if old=new then
begin
Row:=i;
exit;
end;
end;
end;
end;
procedure savetofile(path:string);
var