Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6 Tip-o-the-day
Message
From
17/07/1998 17:39:28
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00118034
Message ID:
00118821
Views:
18
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform