Inequality test on boxed types (yes, I did something wrong :-) )

No, I does not wok in C#.

I see now too where the problem is coming from.

In VB, Object is the dynamic type, so a value boxed into an object is always unboxed when used.
Als, in VB the keyword “Is” and “IsNot” is for reference tests, = and <> for the implemented operator test.

In C# and Oxygene Dynamic is a separate type and there is no difference between a reference or implemented operator test, what means that I have to assign to a dynamic variable first to get the correct behavior.

So the correct code Is (to get what I want):

var current: dynamic := e.Row.Item[i, System.Data.DataRowVersion.Current];
var original: dynamic := e.Row.Item[i, System.Data.DataRowVersion.Original];
if current <> original then
    //do something
1 Like