Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
NEWOBJECT() Has no parent.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00384767
Message ID:
00384776
Vues:
23
Bill,

>Who is oChild's parent?

No one is.

This ties back to all the earlier messages in your other threads. .Parent implies containership of one object in another. A container object's .AddObject() method is the only way to get an object contained within another at runtime.

this.AddObject( "oChild", "custom" )
? this.oChild.Parent.name

An object created with NewObject() or CreateObject will never have a .parent value because it's not contained by an object. You have an object reference to the newly created object, but this it not the same as containership.

>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
>
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform