Base Macro to Determine Control Type
Is there a property or method of a control that reliably reveals its type? For example, can I determine if a given object is a form, table control, list box or text box? I am trying to simplify some of my subroutines and functions so that inside them, they can determine the control type and take different actions accordingly. Or better yet, write a function that receives a control object, and returns a string telling the type of the control so I could reuse the function throughout my code. I'm particularly interested at the moment to determine if a given object is a table control, but the other types would be useful to determine as well.
I did finally figure out how to use MRI, so I can generally view the methods and properties of any object. I'm just not sure how to test for the type of a control. I suppose I could find some property that is unique to a table control or list box and check whether those methods/properties exist or something like that.
It would also be cool if there was a way to determine the format of the data in a control (kind of the same as the first question/paragraph). For example, is it numerical, currency, text, date, time, etc.? In some of my functions I pass a string parameter that tells the type in advance, like sFormat = "string", "currency", "long", "integer", "double", "float", "listbox", "null", etc. If there was a way to determine the data type programmatically, I could skip having to tell the functions what the type is, which would be nice.