Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can a class see what it's instantiated as?
Message
From
09/10/2015 09:48:25
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01625748
Message ID:
01625764
Views:
52
>>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.
>
>Strange,
>it is not for me (check attached picture)
>But Lutz is right, if you instantiate this class in some property you will not see it.

Thanks anyway. However, it's not the end of the world, just another property to set.
Previous
Reply
Map
View

Click here to load this message in the networking platform