Implicit data type mappings
- Last Updated: June 18, 2019
- 3 minute read
- OpenEdge
- Version 13.0
- Documentation
Implicit data type mappings
The following table shows the implicit mappings between .NET mapped data types and ABL primitive types. These .NET mapped data types are shown in two forms—as object types and as C# primitive data types. .NET has more mapped data types than the ABL has primitive types. So, more than one .NET type often maps to a single ABL primitive type. Where an exact mapping is not possible, ABL uses the primitive type that most completely holds the value. For these cases, and a few others, run-time errors can result if a provided value does not fit into the destination data type. Entries in the table have footnotes to indicate where any special conditions can or do occur. For more information on these conditions, see the sections following the table.
Note also that ABL supports similar implicit mappings between ABL primitive arrays and .NET arrays of mapped data types. For more information, see Implicit array mappings.
| Implicit .NETobject type | Implicit C#primitive data type | Implicit ABLprimitive type |
|---|---|---|
System.Boolean |
bool
|
LOGICAL
|
System.Byte
|
byte
|
INTEGER1,2
|
System.SByte
|
sbyte
|
INTEGER1
|
System.DateTime
|
– |
DATETIME
|
System.Decimal
|
decimal
|
DECIMAL3,4 |
System.Int16
|
short
|
INTEGER1 |
System.UInt16
|
ushort
|
INTEGER1,2
|
System.Int32
|
int
|
INTEGER4
|
System.UInt32
|
uint
|
INT645,2
|
System.Int64
|
long
|
INT644
|
System.UInt64
|
ulong
|
DECIMAL2,6 |
System.Double
|
double
|
DECIMAL7 |
System.Single
|
float
|
DECIMAL7 |
System.Char
|
char
|
CHARACTER8 |
System.String
|
string
|
CHARACTER4
|
System.String to
either CHARACTER or LONGCHAR, depending on the length of the character string. When the
value comes from ABL, System.String accepts values from either CHARACTER or LONGCHAR.