var
FieldName, DecFld, upMark, dnMark: string;
i: Integer;
begin
if SortData.IsEmpty then System.exit;
upMark := '▼';
dnMark := '▲';
if pos('*',PFieldname)>0 then
PFieldname:=copy(PFieldname,1,pos('*',PFieldname)-1);
for i := 0 to SortData.FieldCount - 1 do
begin
if pos(upMark, SortData.Fields[i].DisplayLabel) > 0 then
SortData.Fields[i].DisplayLabel := copy(SortData.Fields[i].DisplayLabel,
1, pos(upMark, SortData.Fields[i].DisplayLabel) - 1);
if pos(dnMark, SortData.Fields[i].DisplayLabel) > 0 then
SortData.Fields[i].DisplayLabel := copy(SortData.Fields[i].DisplayLabel,
1, pos(dnMark, SortData.Fields[i].DisplayLabel) - 1);
if SortData.Fields[i].FieldName = PFieldname then
begin
if (SortData.Fields[i].FieldKind = fkData) and (SortData.Fields[i].DataType
<> ftBlob)
and (SortData.Fields[i].DataType <> ftMemo) and
(SortData.Fields[i].DataType <> ftGraphic) then
begin
if IsAec then
SortData.Fields[i].DisplayLabel := SortData.Fields[i].DisplayLabel +
upMark
else
SortData.Fields[i].DisplayLabel := SortData.Fields[i].DisplayLabel +
dnMark;
end
else
System.exit;
end
else
begin
continue;
end;
end;
SortData.IndexDefs.Clear;
SortData.IndexDefs.Update;
if IsAec then
DecFld := PFieldname;
IsAec := not IsAec;
FieldName := PFieldname;
if FieldName <> '' then
begin
with SortData.IndexDefs.AddIndexDef do
begin
IndexFld := IndexFld + 1;
Name := IntToStr(IndexFld);