如何使用 RTTI 访问 Delphi 数组属性

发布于 2024-07-29 04:30:50 字数 167 浏览 4 评论 0原文

我熟悉使用 Delphi RTTI 访问“简单”属性(整数/枚举/字符串等),但我无法掌握如何使用数组属性。

我首先寻找 GetPropValue/SetPropValue 调用的数组等效项。 我希望看到与这些类似的内容,但采用额外的“索引”参数,但似乎在typinfo单元帮助中找不到任何内容。

I'm familiar with using Delphi RTTI to access "simple" properties (ints/enums/strings, etc) but I cannot grasp how to work with Array properties.

I'm starting by looking for array equivalents for the GetPropValue/SetPropValue calls. I'd expect to see similar ones to these, but taking an extra "index" parameter, but can't seem to find anything in the typinfo unit help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

〆凄凉。 2024-08-05 04:30:50

数组和数组属性在 D2009 之前不能具有 RTTI。 但是,当 Barry Kelly 在 Delphi Live 会议上谈到计划在 D2010 中使用的增强型 RTTI 系统时,他提到包括阵列在内的所有东西都将具有 RTTI。 所以这是一个值得期待的功能...

Arrays and array properties can't have RTTI for them up to D2009. But when Barry Kelly spoke at the Delphi Live conference about an enhanced RTTI system that's planned for D2010, he mentioned that everything, including arrays, would have RTTI available. So this is a feature to look forward to...

千と千尋 2024-08-05 04:30:50

不确定是否可能。 数组属性无法发布,这意味着它们没有 RTTI。

另外,如果您查看对象检查器中的组件。 那里没有数组属性。 所有数组属性都有自定义编辑器(或者我一定错过了一些)。

Not sure if it is possible. Array properties can't be published which implies they can't have RTTI.

Also, if you look at the components in the object inspector. There are no array properties there. All array properties have custom editors (Or I must have missed some).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文