Is it possible to create a reference to a specific property of a class/object, not just to the object itself?
I’m trying to enhance some of my true “RAD” classes and controls, and I want to generically link properties of a given object (say an object representing a database row) to properties of a control (value of a textfield control or cell of a listbox) so that the control can retrieve then write back the data values automatically without having to specifically write the code to do it each time.
So is this even possible in Xojo or just a pipe dream?
when I have needed to do this I have the control just hang on to the NAME of the property
then I have a “get by name” and “set by name” on the source object
those take a variant and return a variant and use introspection internally so its reasonably generic (I can add it to just about any class without having to rewrite it all the time)
its not perfect but it works
I was thinking along those lines, but wanted to make sure there wasn’t a better way.
yeah there is nothing that permits you to have a reference to intrinsic types like integer, double etc
nothing like a C ptr to a base type