Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: skip the Assign destroy object or fire a C5 crash
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00893546
Message ID:
00893699
Views:
18
>George,
>
>Nothing of the sort. I'm buffled that you don't understand difference between checking if objects are the same (loObj1 = lObj2) and checking if objects are alike (COMPOBJ(loObj1, lObj2)).
oLabel1 = CREATEOBJECT('Label')
>oLabel2 = CREATEOBJECT('Label')
>oLabel3 = oLabel1
>? oLabel1 = oLabel2 		&& .F. - they're two different objects
>? oLabel1 = oLabel3 		&& .T. - the same object
>? COMPOBJ(oLabel1, oLabel2) && .T. - Object's are alike but we cannot tell if it's the same object
>? COMPOBJ(oLabel1, oLabel3) && .T. - Object's are alike but we cannot tell if it's the same object
>
>oLabel1.Caption = "Two"
>? oLabel1 = oLabel3 		&& .T. - still
>? COMPOBJ(oLabel1, oLabel2) && .F. - Woops! They are different objects
Sergey,

Within a given method, you can make no assumptions (particularly within an _assign method) about what the object is like. Therefore, if I'm going to try to determine if there're alike, I'll stick with COMPOBJ()
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform