Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
NEWOBJECT() Has no parent.
Message
 
 
À
26/06/2000 16:24:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00384767
Message ID:
00384781
Vues:
39
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform