Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Testing a objects existence
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00366567
Message ID:
00366671
Views:
16
Eric,

It is really very simple.
oObj = CreateObject("Whatever")
* oObj has been created as a variable and has a type of O for object

?oObj.Name
* Displays the value of teh Name property of object oObj

?TYPE("oObj.Name")
* Returns C because the Name property of the object does is character type

oObj = .NULL.
* The object oObj is destroyed but the variable still exists and is type O 
* and value NULL

?oObj.Name
* Error since oObj does not exist as an object, it does as a variable

? TYPE('oObj")
* Returns O because the datastype of oObj is Object, even though its value
* is NULL

?TYPE("oObj.Name")
* Returns U because the Name property of the object does not exist
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform