Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Comparing objects
Message
De
07/08/1998 15:47:53
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00124254
Message ID:
00124916
Vues:
16
>>Don't we have a function called CompObj()? And the Tamar's hackers' guide has some tips and tracks when using this functions.
>>
>>Chris Lee
>
>Chris,
>
>yes ther is afunction named CompObj() but it does tell if the two object reference point to the same object. It only tells you that all of the property values or the two object have the same values. That could cause a problem by saying that two objects are the same when in fact they aren't.
>
>Thats is why my suggestion first comapre the names of teh two object adn then the names of each one's parent object. If they have the same name and they in the same container then they must be the same object. VFP would bark up a storm if we tried to put two object with the same name in the same container.

Well, this makes CompObj() usable in this case - name is also a property, so it should be sufficient. While we're at it, is there any other way to make two objects comparable via CompObj() except Scatter ...Name? No, even that wouldn't make them the same, because they'd have different names. No, just tried it - they don't have names :). I've even tried to CreateObject() two objects, and they, of course, got different names. If they even had same names, they'd have to belong to different containers, so their .Parent would be different.

So, let's rephrase the question: is there any other possibility of CompObj() returning .t., except
Scatter Name - twice the same record to different objects
obj1=obj2 - which makes them actually two references to the same memory block containing one object.

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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform