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 根据ip获取局域网mac

Delphi 脉搏波9808血压计读取测试程序

Delphi 利用tidhttp实现文件下载的分块断点续传

Delphi 一个中英文记录Delphi实现

Delphi 基础学习 字符串去掉回车符

Delphi fmx getapppath 获取app路径

Delphi 两种登录界面验证写法

Delphi rest/post

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



打赏

取消

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

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

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

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

评论

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