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

An ABL INT64 larger than its .NET System.UInt32 destination

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