Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Index properties as all other properties (except direct references to object fields) just a shortcut to <code>getXXX</code> and <code>setXXX</code> methods.</p> <p>Try that way:</p> <ol> <li><p>Get all indexed properties of <code>Ctx.GetType(MyComponent1.ClassInfo)</code> with <a href="http://docwiki.embarcadero.com/Libraries/XE2/en/System.Rtti.TRttiType.GetDeclaredIndexedProperties" rel="nofollow noreferrer"><code>GetDeclaredIndexedProperties</code></a> or <a href="http://docwiki.embarcadero.com/Libraries/XE2/en/System.Rtti.TRttiType.GetIndexedProperties" rel="nofollow noreferrer"><code>GetIndexedProperties</code></a></p></li> <li><p>Search desired <code>Property</code> in returned array of <a href="http://docwiki.embarcadero.com/Libraries/XE2/en/System.Rtti.TRttiIndexedProperty_Properties" rel="nofollow noreferrer"><code>TRttiIndexedProperty</code></a> instances.</p></li> <li><p>Get write method description object from <a href="http://docwiki.embarcadero.com/Libraries/XE2/en/System.Rtti.TRttiIndexedProperty.WriteMethod" rel="nofollow noreferrer"><code>WriteMethod</code></a> property of <code>TRttiIndexedProperty</code> object found.</p></li> <li><p>Get method parameters description if you need it with <a href="http://docwiki.embarcadero.com/Libraries/XE2/en/System.Rtti.TRttiMethod.GetParameters" rel="nofollow noreferrer"><code>GetParameters</code></a> call.</p></li> <li><p>Call <a href="http://docwiki.embarcadero.com/Libraries/XE2/en/System.Rtti.TRttiMethod.Invoke" rel="nofollow noreferrer"><code>Invoke</code></a> method of method description object with constructed parameter(s) list to set a property value.</p></li> </ol> <p><strong>Update</strong></p> <p>This works only in Delphi versions from XE2 and above. </p> <p>In previous versions indexed properties can be adopted for RTTI only using things like discussed in <a href="https://stackoverflow.com/questions/2491308/delphi-rtti-for-indexed-properties-in-2010">this question</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload