Enumeration member access
(Windows only; GUI for .NET only)References a .NET enumeration member in order to read its value.
Syntax
type-name
The type name of a .NET enumeration whose member you want to access. Specify an enumeration type name using the syntax as described in the Type-name syntax reference entry. With an appropriate USING statement, you can specify an unqualified .NET enumeration name.enum-member
Specifies a name that identifies a specific member of the enumeration. In ABL, an enumeration member is an object that represents a constant value with a specific underlying data type defined for the enumeration. All members of an enumeration share the same underlying data type. Wherever you reference an enumeration member, ABL references the member object, not the defined constant value that the specified member represents. However, because a .NET enumeration is a value type, when you pass the enumeration member to a .NET method parameter or assign it to or from a .NET property or data member, ABL automatically converts between the .NET value and the ABL object that represents it.ExampleTo set the background color of a button (
button1
) to the known system color, aqua, you might enter this ABL code to set the BackColor button property to the value of the appropriate System.Drawing.KnownColor enumeration member:
Notes
- A .NET enumeration can be an inner member of a class or its own type. For more information on referencing enumerations, see the Type-name syntax reference entry.
- Because, in ABL, .NET enumeration members are objects, you cannot operate on them directly using ABL operators the way .NET languages use built-in operators to operate on enumeration values. To allow you to perform .NET enumeration operations, ABL supports an OpenEdge .NET class, Progress.Util.EnumHelper. The Progress.Util.EnumHelper class contains static methods that you can use to perform the relational, arithmetic, and bit-wise operations commonly applied to enumeration members in .NET.
See also
OpenEdge Release 10.2B
|