Delphi TDictionary 泛型如何排序


本文整理自网络,侵删。

 
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调用http接口方法

Delphi 字符串、文件路径 排序算法

Delphi批量删除同类文件(带通配符)

monthoftheyear:取得一个tdatetime变量的月份在年度中的索引

Delphi tnethttpclient的用法

Delphi mscomm 比较完整的用法例子

Delphi adoquery查询更改用户

Delphi硬盘序列号修改器源码

Delphi 如何从dll中检索导出函数的列表

Delphi xe5做一个android网页框架

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...