print CreateObject("roMessagePort") <> CreateObject("roMessagePort")
Type Mismatch. (runtime error &h18)
port1 = CreateObject("roMessagePort")
port2 = CreateObject("roMessagePort")
If port1 <> port2 Then
End If
?type(port1)=type(port2)
if type(port1)="roMessagePort" and type(p2)="roMessagePort" then
print "Both are message ports"
else if type(port1)="roMessagePort and type(p2) <> "roMessagePort" then
print "Only Port1 is a message port"
else
print "Only Port2 is a message port".
end if
if type(o1) = type(o2) then
? (o1 = o2)
endif
"EnTerr" wrote:
I am away from Roku players so can't check to see the exact error but if it throws "type mismatch" error, that is a clear bug that should be logged (to fix or not is another story).
"TheEndless" wrote:
With very few exceptions, none of the Roku roXXX components can be compared by reference. Definitely a shortcoming, and a pain in the neck, but I don't know if they'd classify it as a bug.
"EnTerr" wrote:"TheEndless" wrote:
With very few exceptions, none of the Roku roXXX components can be compared by reference. Definitely a shortcoming, and a pain in the neck, but I don't know if they'd classify it as a bug.
I had no idea non-comparability was that pervasive. Yes, that's not simply a bug but an omission in the language of a... well, moderate size. Either way should be considered for correction. Implementation-wise "=" checking for identity (reference equality) will be easy, question is persuading the language architect it is a good thing.
You said "with a very few exceptions" - do you know of any at all?
Quick check and now it seems logical to me that all "object" types do not compare - starting with arrays [], dictionaries {} and going through all ro* intrinsics. In addition functions and interfaces, they don't compare either. The rest (numbers, strings, booleans) compare - and invalid is very interesting case, being pansexual - it "=" mates with everything.
"TheEndless" wrote:"EnTerr" wrote:You can compare two roFunction references for equality (which is handy for pseudo-inheritance overrides/overloads).
You said "with a very few exceptions" - do you know of any at all?