Try OpenEdge Now
skip to main content
GUI for .NET Programming
Using .NET data types in ABL : Implicit data type mappings : An ABL DECIMAL larger than its .NET System.UInt64 destination
 

An ABL DECIMAL larger than its .NET System.UInt64 destination

ABL maps the ABL DECIMAL to the .NET System.UInt64 because the unsigned value of System.UInt64 can be twice as large as the maximum signed integer value that an ABL INT64 can represent. However, the ABL DECIMAL can hold values many times larger than a .NET System.UInt64. The following example raises a run-time error because dResult is too large for the System.Math.Max( ) method to compare as a System.UInt64:
DEFINE VARIABLE dResult AS DECIMAL NO-UNDO.
DEFINE VARIABLE dTest AS DECIMAL   NO-UNDO.
ASSIGN
  dResult = 200000000000000000000
  dTest   = System.UInt64:MaxValue
  dResult = System.Math:Max(dTest AS UNSIGNED-INT64,
                            dResult AS UNSIGNED-INT64). /* Run-time error */