Documentation for TPropInfo NameIndex and Index
The documentation for TPropInfo NameIndex and Index is not clear (or not correct depending on how you interpret it):
https://www.freepascal.org/docs-html/rtl/typinfo/tpropinfo.html
Index: Integer; Index for array properties
...
NameIndex: SmallInt; Index for indexed properties
I propose this:
Index: Integer; Stores the "Index Specifier" value from the property declaration
...
NameIndex: SmallInt; This property's index within the list of unique names of published properties
For my simple tests, NameIndex matches the index into the unsorted GetPropList. The list of published property unique names seems to be built starting at the parent class and working through descendants in order.
PropCount := GetPropList(AClass,PropListPtr);
try
for PropListIdx := 0 to PropCount-1 do
PropInfo := PropListPtr^[PropListIdx]^; //PropListIdx matches PropInfo.NameIndex
Edited by Wayne Sherman