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

An ABL INTEGER larger than its .NET destination

The following example raises a run-time error because the size of an ABL INTEGER value is incompatible with the .NET data type of a method parameter:
DEFINE VARIABLE iResult AS INTEGER NO-UNDO.
iResult = System.Math:Min
            (30000 AS SHORT, 60000 AS SHORT). /* Run-time error */
In this case, the .NET static Min( ) method compares two System.Int16 parameters and returns the smaller value. However, an ABL INTEGER value of 60000 is too large for a signed 16-bit number.
Note: The AS option in a method parameter identifies the specific .NET data type that the method parameter takes. For more information, see Passing ABL data types to .NET constructor and method parameters.