>>I have a moment of brain shortage, right now I can't see the forest for all the trees. Is it possible from within an object to know what is the name it's instantiated as? Given this code
>>
>>
>>loCountries = NewObject('SqlTable','SQL.vcx')
>>
>>In this case I want the class SqlTable to understand that it's instantiated as loCountries. I am building a rather complicated generic class to work with SQL tables. My idea is that if I call the object for instance loCountries, my class can be smart enough to know that I want it to connect to the SQL table called Countries.
>
>It seems wrong way to go about it. A Class/Instance shouldn't know or care how it's instantiated.
I am likely completely mistaken on how things work, but I can't see how an object could tell (at least at the time of instantiation) what identifier it has been assigned to (if I'm not mistaken the object instantiates *before* the assignment). I'd suggest you're probably better off passing the necessary details (e.g. table name in your case) as parameters.