How do I access Delphi Array Properties using RTTI

2019-06-19 08:17发布

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.

2条回答
放我归山
2楼-- · 2019-06-19 09:15

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).

查看更多
冷血范
3楼-- · 2019-06-19 09:20

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...

查看更多
登录 后发表回答