讨论一下TDicionary
delphi吧
全部回复
仅看楼主
level 12
ayi033 楼主
TMatch = Record
Date:Integer; //日期
Time:Integer; //时间
Serial:Int64; //订单号编号
ID:Int64; //交易帐号
Name:Array[0..29] of AnsiChar; //姓名
Flag:Integer; //保留
Goods:Array[0..19] of AnsiChar; //商品
BuySell:AnsiChar; //买卖
Price:Double; //价格
Amount:Integer; //数量
End;
TDictionary<integer,TMatch>
需要对Date,Time,Price进行排序
2014年01月23日 05点01分 1
level 12
ayi033 楼主
2014年01月23日 05点01分 2
吧务
level 14
如果非要排序,就用TList<TMatch>。使用IComparer
2014年01月23日 05点01分 3
ICompare<T>;不能同时指定多个元素吧。排序可能只能自己算。但是如果用list的话,查找指定的Match就只能历遍了,会慢很多.所以我想把List和Dictionary结合使用,不知道有不有必要?这也是我第一个用XE的程序,算是摸索了。
2014年01月23日 06点01分
回复 ayi033 :可以同时指定多个元素。
2014年01月23日 09点01分
回复 BambooCaep :好的,谢了。我现在只用TList,排序自己写了个,还可以用。1W条不到1秒.有时间我研究一下ICompare.而且历遍花时间也不多.THKS.
2014年01月23日 09点01分
1