本文整理自网络,侵删。
uses Generics.Collections; {Delphi 2009 新增的泛型容器单元}
var aa: TDictionary<integer,integer>; arr : TArray<Integer>; n : integer;begin aa := TDictionary<integer,integer>.Create; try aa.add(1,11); aa.add(2,22); aa.add(3,33);
arr := aa.Keys.ToArray; TArray.Sort<Integer>(arr);
for n in arr do ShowMessage(IntToStr(aa[n])); finally aa.Free; end;
相关阅读 >>
Delphi中使用xmlhttp / xmlhttprequest 避免缓存
Delphi idhttp returning http 1.1/500 显示错误内容
Delphi中exit,abort,break,continue,halt,runerro 的区别
Delphi xe android platform uses-permission[1] 权限列表
Delphi firemonkey应用程序中显示时隐藏虚拟键盘
更多相关阅读请进入《Delphi》频道 >>