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 10.2 ide界面

Delphi 文件分割合并

Delphi的split函数 4个版本

Delphi 杨辉三角

Delphi ��b以 listbox 的item �� hint

Delphi findwindow的一些用法

Delphi 读写附加数据

print documents from Delphi - print pdf, doc, xls, html, rtf, docx, txt

Delphi xe取得硬盘序列号代码 复制代码

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



打赏

取消

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

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

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

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

评论

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