Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP6 Tip-o-the-day
Message
De
17/07/1998 17:39:28
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00118034
Message ID:
00118821
Vues:
17
>Folks,
>
>Here's a really neat one. In VFP6 you can compare two object references using the = sign to find out if they both refer to the same object.
>
>

>
>o1 = CreateObject("MyClass")
>o2 = CreateObject("MyClass")
>o3 = o1
>
>? o1 = o2 && displays false these are not the same object
>
>? o1 = o3 && dislays true these are the same object

One more reason to use objects instead of arrays :). You can't do this with an array, unless you write some comparing code. Though, with arrays you can produce two arrays whose elements will be equal, and with objects it just means both object references point to the same memory block where the instance is.

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