Try OpenEdge Now
skip to main content
GUI for .NET Programming
Using .NET data types in ABL : General ABL support for .NET types : Support for .NET mapped object and primitive data types

Support for .NET mapped object and primitive data types

ABL defines implicit mappings between .NET mapped data types and appropriate ABL built-in primitive types. For a .NET data member, property, or method return value that you assign, or a .NET method parameter that you pass, you can assign or pass an ABL primitive type that corresponds to the .NET mapped data type of the particular data member, property, method return value, or method parameter. In fact, you cannot define an object reference to or instantiate any .NET mapped object type in ABL as an object using the NEW function (classes). This means that, in ABL, you cannot directly assign or pass between ABL and the .NET context any instance of a .NET mapped data type as an object.
For example, you can never have an object reference to a System.Boolean or System.Double class instance. So, to set a System.Boolean or System.Double property, you must use a corresponding ABL LOGICAL or DECIMAL value. Note that, in ABL, you can assign .NET properties and data members defined as .NET mapped data types to other .NET properties and data members, and you can pass .NET properties, data members, and method return values defined as .NET mapped data types to .NET method parameters. However, ABL evaluates the assigned or passed .NET mapped data types as ABL primitive values before completing the assignments or passing the parameters.
Note: In ABL, you can reference .NET mapped object type names in order to access their static members, you can refer to their type names as character strings in order to create .NET arrays of mapped types, and you can define an object reference to an array of mapped types.
You can thus use ABL primitive types according to implicit data type mappings to access all supported .NET class members, including:
*Passing .NET constructor or method parameters
*Getting method return values
*Setting and getting .NET property values
*Assigning values to and from .NET data members
For more information, see Implicit data type mappings.
ABL also defines widening relationships that allow you to specify additional ABL data types for some of these implicit mappings when passing constructor or method parameters. And, because ABL does not support a unique primitive type that corresponds to every .NET mapped data type, some ABL primitive types map to multiple .NET data types. For constructor or method parameters, ABL also allows you to specify the exact .NET data type you want to map when more than one mapping is possible, especially to identify a particular method overloading to use. For more information, see Passing ABL data types to .NET constructor and method parameters.