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:
00384781
Views:
32
Unless an object is AddObject/NewObject to the parent, then the Parent property does not hold a reference to anything.

Bill,
Using the NewObject function creates a free standing object. The new object will not be associated with the parent object just because you assign a property value to it. If you use the NewObject method of the parent class:

THIS.NewObject("oChild","custom")

the oChild.Parent returns the correct object.

>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?
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform