Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object comparison
Message
De
12/10/1999 10:59:31
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
 
 
À
12/10/1999 10:52:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00275435
Message ID:
00275443
Vues:
22
>Hi All,
>
>In VFP6, we now have the ability to use the "=" sign to compare objects. I have a situation using the "=" sign where it will always return .F., and I don't think it's supposed to. Try this:
>
>USE atable
>GO TOP
>SCATTER NAME object1
>SCATTER NAME object2
>
>As you can see, objects 1 and 2 are created from the same table and row. So, why would ?object1=object2 return .F.?
>
>Am I missing something fundamental here?

Object comparison only returns .t. if the two variables are references to the same physical object.

SO

** Create two references to the same object
x = _SCREEN
y = _SCREEN
? x = y

gives .t.


** Create two similar objects of identical class
x = CREATEOBJECT("Form")
y = CREATEOBJECT("Form")
? x = y

gives .f.
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform