Rtti for complex object

36 views
Skip to first unread message

Luis Enrique Pettinari

unread,
Mar 20, 2024, 7:11:15 PMMar 20
to Spring4D
Let's say I have the follow data structure:

TCat = class
  property RightEye: TEye;
end;

TEye = class
  property Color: TColor;
end;

Now suposse I have an instance of Cat and the RttiProperty of the Color property, is there a way to get the Color value for that instance?

Stefan Glienke

unread,
Mar 20, 2024, 7:15:31 PMMar 20
to Spring4D
colorProp.GetValue(cat.RightEye);

But how is this a spring4d question?

Luis Enrique Pettinari

unread,
Mar 21, 2024, 8:13:59 AMMar 21
to Spring4D
Well, I was hoping spring4d could help me with this. In fact I'm working in Marshmallow improvements, adding the Embedded attribute, so I though that I could ask for help here.
But if it is off topic, forgive me and forget the question
Reply all
Reply to author
Forward
0 new messages