Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: skip the Assign destroy object or fire a C5 crash
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00893546
Message ID:
00893638
Vues:
21
Hi George,

>You're right, of course. It is, however, only true if the second object variable is the result of an assignment statement. For example (as I posted earlier)
oLabel = CREATEOBJECT('Label')
>oLabel1 = CREATEOBJECT('Label')
>? oLabel = oLabel1 && .F.
>? COMPOBJ(oLabel, oLabel1) && .T.
The problem here is that with an assign method, there's always a chance, especially in this case, where the parameter passed isn't the result of a direct assignment statement between the exact same object. Therefore, the prudent programmer uses COMPOBJ() to properly evaluate two objects.


And such programmer would be wrong because the COMPOBJ() will not tell you if it's the same object, only if both objects have the same number of properties and properties values match. But you would only want to skip assigment if you already have reference to the object passed to assign method not if the object just looks alike.

>Are there exceptions, sure. For example,
oForm = CREATEOBJECT('Form')
>oForm1 = CREATEOBJECT('Form')
>? COMPOBJ(oForm, oForm1) && .F. because they have different window handles.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform