Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
NEWOBJECT() function vs NewObject() method
Message
De
16/02/2011 06:34:54
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
16/02/2011 06:23:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01500348
Message ID:
01500350
Vues:
86
>Dear Experts,
>
>This.myProperty = NEWOBJECT( "myClass", "myClassLib" )
>&& ...and...
>This.NewObject( "myProperty", "myClass", "myClassLib" )
>
>
>Are the two statements above same? If not, how are they different? Can they be used interchangeably?

Almost the same. In the first case, however, the object is standalone, and the property holds a reference to the object. The object doesn't have a parent. Parent can reference it, but it can't reference the parent, unless you find a way to pass a reference to it.

In the second case, the object is a member of This, and This is its .Parent, i.e. the object becomes a full member of the containership hierarchy.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform