Finding out the class of an object

This should be simple, but I am not finding a simple answer in my searches.

I have an object and I want to know what class it is. I want a text string of the name of the class.

TIA

What is it you’re trying to do that you need the name of the class ?
There may be better alternatives than the name as a string

Norman
You might be right about that. I am making controls using Canvas, and containing those in a custom container built on Canvas. Kind of reinventing the wheel because ContainerControl doesn’t do what I need.

I think a better answer is to have the controls generate events. As they are added to the container in code, then I will have to use AddHandler. I think this should work. Thanks.

Serialization of objets (Loading / Saving), maybe? I mean, there some cases where you need to know the class of an instance.

I don’t have all the Introspection stuff on my mind now, but I think there is specific method por getting the class. I haven’t typed for a couple months, worst coded till yesterday. Don’t have my mind fresh with Xojo docs until a code for a whole week :slight_smile:

I know people try to write generic “serialize everything” code using introspection but its got limits to how much you can do.
In that case introspection will tell you the type easily enough.

But in lots of cases you dont need the NAME of the class what you need is to know if something ISA - hence my question.

I think you’re looking for Introspection.GetType. http://documentation.xojo.com/index.php/Introspection.GetType

In any case, gettype would be the wrong approach for the OP.

Just answering the question.