Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
(Object) = (Object): Operator/operand type mismatch
Message
From
30/10/1998 09:03:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
30/10/1998 05:05:22
Marco Beuk
Innovero Software Solutions
The Hague, Netherlands
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00152639
Message ID:
00152740
Views:
23
>Why can't i check if an object reference equalizes an object refrence:
>
>oObject = This WORKS
>? oObject = This Operator/oparend type mismatch
>
>How should i check if to object refrence refer to the same object (its names are not unique).
>
>Marco Beuk.
Marco,
I think you already have the answer. I just want to summarize and make it clear.
oObject=this works because it's an *assignment*
? oObject = This fails because it's a *comparison test* and you cannot use "=" as comparison operator for objects (in VFP 6 you can as heard - not tested or see).
Compobj() is the key function to compare objects but not enough alone because it simply checks if two objects PEM are identical or not.
A container can have more than one object with *same name*. This is open to discussion as what we call a container (a _screen or application is a container ? - for me yes they should be).
So if we agree a container can hold more than one object with same name, Ken Levy's simple approach is good for identifying instances of same object :
function mycompobj
lparameters o1, o2
local lcName, llSameObject
llSameObject = compobj(o1,o2)
if llSameObject
   lcName = o1.name
   o1.name = "x"+o1.name
   llSameObject = compobj(o1,o2)
   o1.name = lcName
endif
return llSameObject
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
Next
Reply
Map
View

Click here to load this message in the networking platform