I would like to access the following property using RTTI
MyComponent1.Property['variable'].SubProperty
I would like something like that:
var
Ctx: TRttiContext;
Typ: TRttiType;
SubTyp: TRttiType;
Prop: TRttiProperty;
SubProp: TRttiProperty;
begin
Ctx:= TRttiContext.Create;
Typ:= Ctx.GetType(MyComponent1.ClassInfo);
Prop:= Typ.GetProperty('Property['variable'].Subproperty') //not possible
Prop.SetValue(MyComponent1.Property['variable'],'500');
end;
Basically I want to access a subproperty of my component and I have only strings, so I cannot use Typ:=Ctx.GetType(MyComponent1.ClassInfo)
and then Prop:=Typ.GetProperty('Property['variable'].Subproperty')
this is not allowed. Attention in the fact that there is a paramenter for the first property. I guess I have to obtain this first property and then somehow the second property, because I cannot use this property1"."property2
Does anyone know how to do that?
MyComponent1.Property['variable'].SubProperty
But in my code I have a lot of components and properties, so I have to check first MyComponent and then get the property Property['variable'] and then somehow I would like to change SubProperty, but I cannot usesubProp:= Prop.getProperty
orTyp.getProperty('Property['variable'].subProperty')
– BandwidthTyp:=Ctx.GetType(MyComponent1.ClassInfo)
and then Prop:=Typ.GetProperty('Property['variable'].Subproperty')
this is not allowed. Attention in the fact that there is a paramenter for the first property. I guess I have to obtain this first property and then somehow the second property, because I cannot use this property1"."property2 – Bandwidth