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控制面板应用大全

汇编基础寄存器

Delphi中用idhttp获取json数据乱码问题

Delphi restfull api调用方法

Delphi和c++指针详解

Delphi中如何将鼠标放置在控件上就给予提示信息

Delphi 判断一目录是否共享

Delphi里树形菜单的实现

Delphi 软件welcome窗口代码

Delphi trayicon控件,如何实现窗口最小化的时候到系统托盘?

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



打赏

取消

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

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

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

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

评论

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