感谢Avalon,依您的方法实现了排序,下面是实现过程:
......
{$R *.dfm}
function f_SortNumUp(p_Data1, p_Data2: Pointer): integer; //号码升序 ////
begin ////
Result := StrComp(PAnsiChar(PMyRec(p_Data1)^.Strs), ////
PAnsiChar(PMyRec(p_Data2)^.Strs)); ////
end;
//降序
function ListSortMax(iP1, iP2: Pointer):Integer;
begin
if PMyRec(iP1)^.eValue > PMyRec(iP2)^.eValue then
Result := -1
else if PMyRec(iP1)^.eValue = PMyRec(iP2)^.eValue then
Result := 0
else
Result := 1;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
m_NumList:TList;
PR,P
MyRec;
k:Integer;
begin
(* 仅做测试 *)
m_NumList := TList.Create;
New(PR);
PR^.Num := 1;
PR^.Strs := '13345678912';
PR^.eValue := 1.08963;
m_NumList.Add(PR);
New(PR);
PR^.Num := 2;
PR^.Strs := '13045678912';
PR^.eValue := 9.08963;
m_NumList.Add(PR);
New(PR);
PR^.Num := 3;
PR^.Strs := '13145678912';
PR^.eValue := 6.08963;
m_NumList.Add(PR);
TDQuickSort(m_NumList, 0 , m_NumList.Count - 1, ListSortMax);
//TDQuickSort(m_NumList, 0 , m_NumList.Count - 1, f_SortNumUp);
//下面看排序结果
with m_NumList do for k := 0 to Count-1 do begin
p := Items[k];
showmessage(P^.Strs+':'+FormatFloat('0.000000',P^.eValue));
end;
m_NumList.Free;
end;
....
400w的数据速度测试ing....还有查询ing....