Needing some help here
given the following c# code:
and the ABL code:
why doesn't the comparison work, unless I change it to
also, how would I convert the following:
I've tried
but I get an "incompatible data types" message when compiling.
Thanks.
Hi Julian,
the fact, that operator overloading (for enums) is not supported by the ABL is a pitty.
For this case, Shelley and Laura explained it to me as that = or EQ would compare the reference and not the value and since the object in the EventArgs and the static enum are two different references to the same .NET object, the ESQ does not work.
Try the AreEqual method of the EnumHelper instead.
So still room for improvement in 10.2B...
Especially, because you can't use the enumHelper in a CASE structure at all...
The second is a binary operation - I have no clue how to translate that. It's clear, why you get an compiler error: The AND method of the enumHelper returns an System.Enum type and that is not compatible to an ABL primitive integer (your 0).
Maybe something like:
EnumHelper:AreNotEqual(EnumHelper:And(e:Button, MouseButtons:Left), MouseButtons:None)
But I haven't tried that.
Hope that helped at least a little bit.
Mike
Message was edited by:
Mike Fechner
Details on the EnumHelper methods are in the GUI for .NET developers bible at:
http://www.psdn.com/library/entry.jspa?externalID=6151&categoryID=2141
Section 2-56 (or page 90)
Did you try
IF unbox(e:Button) EQ unbox(System.Windows.Forms.MouseButtons:left) THEN
or maybe it's box(), I haven't internalized it yet.