Use the Progress.Util.EnumHelper class
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
The Progress.Util.EnumHelper class provides
public static methods that accept .NET enumeration members as INPUT parameters in the form of System.Enum
objects. These methods then perform common operations on the INPUT members and return either a LOGICAL value
or a new instance of System.Enum, depending on the
operation. Together, these methods support the basic operations that you can perform on a
primitive type in .NET. Note that the available operations on a given .NET enumeration type
depend both on its underlying primitive data type and whether it is defined with the System.FlagsAttribute class to allow bit-wise operations.
The following table lists these methods showing a brief signature and description of the operation that each method performs. For more information on this class and its methods, see the Progress.Util.EnumHelper class reference entry and its respective method entries in ABL Reference.
| Method | Description |
|---|---|
Add( enum1, enum2 )
|
Adds (+) the
underlying values of enum1 and enum2 and returns the sum as a new instance |
Subtract( enum1, enum2 )
|
Subtracts (-) the
underlying value of enum1 from enum2 and returns the difference as a new
instance |
AreEqual( enum1, enum2 )
|
Returns TRUE if
the underlying values of enum1 and enum2 are equal (=);
otherwise, returns FALSE |
AreNotEqual( enum1,
enum2 )
|
Returns TRUE if
the underlying values of enum1 and enum2 are not equal (<>); otherwise, returns FALSE |
IsGreater( enum1,
enum2 )
|
Returns TRUE if
the underlying value of enum1 is greater than
(>) enum2;
otherwise, returns FALSE |
IsLess( enum1, enum2 )
|
Returns TRUE if
the underlying value of enum1 is less than
(<) enum2;
otherwise, returns FALSE |
IsGreaterOrEqual( enum1,
enum2 )
|
Returns TRUE if
the underlying value of enum1 is greater than or
equal to (>=) enum2; otherwise, returns FALSE |
IsLessOrEqual( enum1,
enum2 )
|
Returns TRUE if
the underlying value of enum1 is less than or
equal to (<=) enum2; otherwise, returns FALSE |
And( enum1, enum2 )
|
Applies a bit-wise AND operation between the underlying values of enum1 and enum2, and returns the result as a new instance1 |
Or( enum1, enum2 )
|
Applies a bit-wise OR operation between the underlying values of enum1 and enum2, and returns the result as a new instance1 |
Xor( enum1, enum2 )
|
Applies a bit-wise exclusive OR operation between the underlying values of enum1 and enum2, and returns the result as a new instance1 |
Complement( enum )
|
Applies a bit-wise complement operation to the underlying value of enum, and returns the result as a new instance1 |
The following example performs a bit-wise OR of two AnchorStyles enumeration members, casts and assigns the result
to the Anchor property, and displays that result:
|