Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NEWOBJECT() Has no parent.
Message
 
To
26/06/2000 16:24:50
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00384767
Message ID:
00384779
Views:
28
Not neccesarily. For example objects created with SCATTER NAME do not have a .Parent property (they don't have a .Name property either)
The more reliable way is to check

IF TYPE("myObject.Parent")= "O"
...
ENDIF

>Every object (I think) has a Parent object reference. Try Object.Parent.Name and see what you get.
>
>
>>I have a property on an object that is the refrence to another object (oParent.oChild). Is there a way of finding the "parent" object?
>>
>>More Details:
>>oParent = NEWOBJCT('parent')
>>
>>DEFINE CLASS parent AS custom
>>
>>oChild = .F.
>>
>>FUNCTION init
>>oChild = NEWOBJCET('custom')
>>ENDFUNC
>>
>>ENDDEF
>>
>>Who is oChild's parent?
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform