Human wrote:
> Thank you alot for those information.
> I was pretty sure that it is imposible to get the name of a variable at the
> runtime but I just
> wanted to be sure.
>
> For properties I had a simple component that used the 'is' operator (instead
> of RTTI) to save the
> values to the HDD. It worked very well with Borland's 'standard' components:
> TLabel, TMemo,
> TButton, etc.
> But when it encountered an unknown component like TSomeComponent it skipped
> over that component
> without saving.
>
> Other components had also their own problems. I will look for more
> documentation adout RTTI to
> build my own.
> Generally, every time I used an external component I find out that sooner or
> later I will replace
> that component with my own. The best idea from now on will be to build from
> the start my own
> component instead of using 3rd party
If the component used the "is" operator it wasn't using the full RTTI.
With the full RTTI you don't need to know rather a component is a TLabel
or TMemo. You can simply ask "does this component have a Left property?
Is that property an integer?" and save the property's value if it
exists! On the other hand using the "is" operator you may gain access to
fields that are not properties, but that's not as interesting.
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk