Try OpenEdge Now
skip to main content
GUI for .NET Programming
Using .NET data types in ABL : Implicit data type mappings : Negative ABL values and unsigned .NET destinations
 

Negative ABL values and unsigned .NET destinations

The following example raises a run-time error because of a negative ABL value passed to an unsigned .NET method parameter:
DEFINE VARIABLE dResult AS DECIMAL NO-UNDO.

dResult = System.Math:Max
  (75.0 AS UNSIGNED-INT64, -75.0 AS UNSIGNED-INT64). /* Run-time error */
In this case, the .NET static Max( ) method compares two System.UInt64 parameters and returns the larger value. However, an ABL DECIMAL value of -75.0 is incompatible with an unsigned number.