Performs a bitwise AND operation on two expressions of the same flag enum type and returns a new instance of the same type.
flag-enum-expression AND flag-enum-expression |
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.
DEFINE VARIABLE flagsEnum AS Progress.Reflect.Flags. flagsEnum = Flags:Public OR Flags:Private. IF (flagsEnum AND Flags:Public) EQ Flags:Public THEN... |
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:
IF flagsEnum:IsFlagSet(Flags:Public) THEN... |