【问题标题】:How to use TDictionary?如何使用 TDictionary?
【发布时间】:2009-07-18 23:06:07
【问题描述】:

通过使用 Google,我找到了一些在 Delphi 中使用 TDictionary 的不错的 sn-ps 示例代码,但无法编译其中任何一个。

我使用 Delphi 2009 更新 1、2、3、4。

当我写这个时:

var Dic: TDictionary<Integer,string>;

我得到“未知标识符 TDictionary”

如何使用它们?

【问题讨论】:

    标签: delphi generics delphi-2009


    【解决方案1】:

    您是否已将 Generics.Collections 添加到您的用途列表中?

    【讨论】:

    • 我以为是 NET。谢谢!
    • 是的。 Generics.Collections 专门设计为在接口方面与 .NET 泛型集合类似,但它们的工作方式并不完全相同。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多