Yes, the question is soooo obscure, I can't even tell if it's sane
We have a
TObject.ClassName. I can use it to get the class instance name.
Now for the problem.
I have some data construct (a
TObject-based data container with its own write and read capabilities) which is written into a XML file and subsequently read.
E.g. I need to write "MaxX=1" but, e.g. "maxx=1" looks like a different value to reader/loader. So, I need to back-track that the value would be equal (with equal capitalization) in two different parts of the code (not that it's too complex, but a bit annoying as the data becomes more complex and more numerous).
In other words is there a way I can write:
Container := RootNode.ChildElement({I %VariableName(Container)%}); instead of
Container := RootNode.ChildElement('Container'); or at least to
Container := RootNode.ChildElement(SomePredefinedStringArray[%Container]); where reference goes to variable name, not it's memory pointer as it's not unique.
As a workaround I could "Stick" to the pointers in the specified data container in
constructor Create but it looks dirty and overcomplicated (still that'll guarantee that read and write routines of this class will return always identical names for the read/written variables).
I know there is no way to do this. And that the whole question is stupid and even crazy. But just to make sure