AND operator (bitwise)
- Last Updated: January 18, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Performs a bitwise AND operation on two expressions of the same flag enum type and returns a new instance of the same type.
Syntax
|
- flag-enum-expression
- An expression whose value is a flag enum instance. Both expressions must be the same
flag enum type, and neither expression can be the Unknown value
(
?).
Example
You can use bitwise AND to check to see if a particular flag or flags is set. This code
fragment defines a variable of type Progress.Reflect.Flags (see the Progress.Reflect.Flags enumeration entry for a full list of members) and uses AND
to check to see if the Public flag is set.
|
The bitwise AND operation results in an enum instance in which the only flags set are the
flags set in both expressions. In this case, the resulting instance has the
Public flag set.
You can also use Progress.Lang.FlagsEnum's IsFlagSet( ) method to achieve the same result:
|
Notes
- This operator can be used with both ABL and .NET flag enums.
See also
ENUM statement, IsFlagSet( ) method, NOT operator (bitwise), XOR operator (bitwise), OR operator (bitwise)