Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Comparing objects
Message
From
06/08/1998 02:02:26
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00124254
Message ID:
00124385
Views:
24
>VFP 5.0a
>I created two listboxes on a form with drag & drop capabilities.
>
>If the user drags an item from one listbox, but drops it back in the same listbox they dragged it from, I don't want anything to happen.
>
>In the following code, I am trying to say, "If the oSource object is the same object we are dropping on, do nothing."
>
>Can't objects be compared with the = sign?
>
>In the DragDrop event of each listbox I have the code:
>------------------------------------------------------
>LPARAMETERS oSource, nXCoord, nYCoord
>
>if oSource != this
> oSource.dblclick()
>endif
You can use compobj(oSource,this). Of course there could be two identical objects but it's not likely in your case. Anyway if you want to distinguish it also, temporarily change one's someproperty (ie:left, caption etc) and compobj(), if returns .f. they're the same.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform