Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I access Delphi Array Properties using RTTI

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.

like image 514
Roddy Avatar asked Jul 27 '09 20:07

Roddy


2 Answers

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

like image 131
Mason Wheeler Avatar answered Oct 13 '22 16:10

Mason Wheeler


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

like image 3
Toon Krijthe Avatar answered Oct 13 '22 17:10

Toon Krijthe