OR operator (bitwise)
- Last Updated: January 18, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Performs a bitwise inclusive OR 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 OR to set multiple flags. This code fragment defines a variable of type
Progres.Reflect.Flags (see the Progress.Reflect.Flags enumeration entry for a full list of enumerators) and uses OR to set
both the Public and Protected flags.
|
The following example shows bitwise OR being used with one explicitly named flag and a
variable defined as type Progress.Reflect.Flags. The first bitwise OR sets
the Static and Public flags of
flagsEnum1. The second bitwise OR results in flagsEnum2
having the Static, Public, and Instance
flags set.
|
Notes
- This operator can be used with both ABL and .NET flag enums.
See also
AND operator (bitwise), ENUM statement, Expression, NOT operator (bitwise), XOR operator (bitwise)