(Windows only; GUI for .NET only)
Performs a bitwise AND operation on the underlying values of the specified enumeration types and returns a new instance. You typically use this method to check the state of a flag.
Return type: System.Enum class (from the .NET Framework)
Access: PUBLIC STATIC
Applies to: Progress.Util.EnumHelper class
Specify a static reference to an enumeration value using the following syntax:
Where enum-type is the type name of the enumeration and enum-member is a member name of the enumeration. For example:
The following example uses this method to check the state of a flag:
USING System.Windows.Forms.* FROM ASSEMBLY. USING Progress.Util.* FROM ASSEMBLY. DEFINE VARIABLE rMyStyle AS System.Enum NO-UNDO. /* Adds Bottom and Right to the list */ rMyStyle = EnumHelper:Or( AnchorStyles:Bottom, AnchorStyles:Right ). DISPLAY STRING( rMyStyle ) FORMAT "x(20)" SKIP. /* Displays "Bottom, Right" */ /* Test to see if a flag is set */ rMyStyle = EnumHelper:And( rMyStyle, AnchorStyles:Right ). DISPLAY STRING( rMyStyle ) FORMAT "x(20)" SKIP. /* Displays "Right" */ rMyStyle = EnumHelper:And( rMyStyle, AnchorStyles:Left ). DISPLAY STRING( rMyStyle ) FORMAT "x(20)" SKIP. /* Displays "None" */ |
If you want to use the returned System.Enum instance as a different enumeration type, you must cast the instance to that specific type using the CAST function.
For information on the System.Enum class and .NET enumeration types, refer to the .NET Framework class library.