C# .NET code mapped to OpenEdge GUI for .NET ABL
- Last Updated: February 11, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
The following table compares features of C# .NET code with similar features in ABL code using the OpenEdge GUI for .NET ABL, listed in approximate order of definition and usage.
DEFINE VARIABLE
statement and the newer VAR statement for declaring variables.| Feature | Microsoft .NET C# | .NET for OpenEdge ABL |
|---|---|---|
| Object type-name syntax | C#
Syntax:
Example .NET type names: |
ABL
Syntax:
Example .NET type names: |
| Allowing unqualified type references | C#
Syntax:
Example: |
ABL
Syntax:
Example: |
| Class instantiation |
C# example:
|
ABL example:
Same example
using
|
| Type casting1 | C#
example: |
ABL
example:
Same example using
|
| Instance member reference | C#
Syntax:
Example: |
ABL
Syntax:
Example:
Same example using
|
| Static member reference | C#
Syntax:
Example: |
ABL
Syntax:
Example: |
| Creating and using .NET array objects |
C# example:
|
ABL examples:
Same examples using
|
| Class definition2 | C#
sample: |
ABL
equivalent: |
| Method calling and overriding in class hierarchy3 |
Example inherited C# method:
Example C# usage of inherited .NET DoOp1( )
method: |
Example ABL usage
of inherited .NET DoOp1( )
method:
Same example using
|
| Event declaration and subscription |
C# event declaration and delegate for the .NET FormClosing
event:C# example event subscription and
handler: |
ABL example event
subscription and
handler:
Same example using
|
| Publishing an event in a derived class |
.NET method that fires a FormClosing event:
Example of publishing the event in a C#-derived .NET class:
|
Example of publishing the event in an ABL-derived .NET
class:
Same
example using
|
| Enumeration types and operations | In .NET, you can operate on enumeration
types using the same operators defined for integral primitive types. For example, an
operator such as + is overloaded for both the C# int and enumeration types.
C# use of an enumeration type:
|
In ABL, there is no operator
overloading and .NET enumerations are treated only as class-based objects. To
support operations on .NET enumerations, OpenEdge provides Progress.Util.EnumHelper,
a .NET helper class that defines the following static methods you can use to operate
on enumeration objects as System.Enum types: Add( ), And( ), AreEqual( ),
AreNotEqual( ), Complement( ), IsGreater( ), IsGreaterOrEqual( ), IsLess( ),
IsLessOrEqual( ), Or( ), Subtract( ), and Xor( ) ABL use of an enumeration type:
Same example using
|
| Indexed properties | .NET has a concept both of non-default indexed properties and default properties (also referred to as indexers or indexed properties). Virtually
all indexed properties in .NET are indexers defined with the default property name
Item. The following code shows a sample C# indexer declaration
you might find in .NET documentation for an
Example C# indexer access on a ControlCollection object:
|
ABL documentation refers to .NET
non-default indexed properties simply as indexed
properties and refers to .NET default properties (or indexers) as default indexed properties. However, most indexed
properties you are likely to access are default indexed properties. Where C# considers the indexer to be the indexed property, ABL
refers to an indexer as the subscript syntax used to access a default indexed
property, which you can access in one of two ways. In C#, you can only access a
default indexed property using an indexer on a reference to a class instance.
However, ABL allows you to access a default indexed property using the indexer
either on the property name (
Example ABL default indexed property access on a ControlCollection object:
Same example using
|
| Boxing and unboxing support | Boxing is the process of converting a value type
(such as a C# int or .NET System.Int32) to a reference type object. Boxing a value type wraps the
value inside a System.Object. Unboxing extracts
the value type from the object. Boxing and unboxing between a value type and System.Object can occur during assignment or parameter
passing. In C#, boxing is done automatically but can be done
explicitly. Unboxing can only be done explicitly by casting from the
|
ABL provides three basic levels of automatic
boxing and unboxing support:
In all other situations, for example, parameter passing for
ABL routines and assignment from a System.Object to an ABL primitive type,
automatic boxing is not supported. Where automatic boxing is not supported, you
can explicitly box and unbox between these ABL and .NET types using the ABL
Note: Automatic boxing support between ABL arrays of
primitive types and .NET arrays of implicitly mapped types does not include widening support between corresponding array
elements. The array elements must be implicitly mapped.
ABL example using iNetArr from .NET:
Same example
using
VAR: |
| Type conversion and mapping | In .NET, type conversion can only occur using boxing and
unboxing. For more information, see the Boxing and unboxing support in this
table..NET also supports aliasing between each .NET primitive type (such as C#
int) and a corresponding .NET value type object (in this case,
System.Int32). This allows you to assign between the primitive
type and its corresponding object type and to otherwise refer to one type as the
other without casting. However, this is not a type conversion, as the two types (for
example, C# int and System.Int32) are really
identical. Aliasing, thus, allows all .NET languages to use the same type
library. |
ABL also provides a form of boxing support to convert ABL primitive and array types to .NET object types (see the Boxing and unboxing support in this table).In addition, ABL supports a form of mapping between ABL primitive or array types and compatible .NET scalar or array types. For ABL primitive types, this mapping relies on existing .NET aliasing, but supports true type conversion between the ABL and corresponding .NET types. For more information, see Implicit data type mapping between ABL primitive and .NET types.4 |
Example of type aliasing in C#:
|
Example of type mapping in ABL using Property1 and Property2 from
.NET:
Same example
using
|
|
|
Note: ABL provides built-in data type conversion functions
that you can call to convert one ABL primitive type to another. For example, a
call to In addition, if you call an ABL
data type conversion function on an object reference, ABL does not attempt to
convert the value to the specified data type that the referenced object happens to
represent. Instead, the function returns the ID of the referenced object as the
primitive type specified by the conversion
function:INTEGER("99") converts the string,
"99", to the INTEGER value, 99. However, note
that these functions are not casting operations. The value from a data type
conversion function is not the same object represented as a new type, as in object
type casting, but is actually a value of one primitive type converted to an
equivalent value in another primitive type.Thus, this statement might display the following
message, where 1022 is the object ID of the System.Object referenced by y:Note
also that when you reference a System.Object
directly in a MESSAGE statement and the System.Object represents a .NET mapped type (such as a
System.Int32), the statement automatically calls
the ToString( ) method on the object (in this
case, y:ToString( )), which returns the object's
value as a string (in this case, "99") instead of
its object ID. |
||