Try OpenEdge Now
skip to main content
ABL Reference
ABL Syntax Reference : OR operator (bitwise)
 

OR operator (bitwise)

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 OR flag-enum-expression
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.
DEFINE VARIABLE flagsEnum AS Progress.Reflect.Flags.

flagsEnum = Flags:Public OR Flags:Protected.
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.
DEFINE VARIABLE flagsEnum1 AS Progress.Reflect.Flags.
DEFINE VARIABLE flagsEnum2 AS Progress.Reflect.Flags.

flagsEnum1 = Flags:Static OR Flags:Public.
flagsEnum2 = Flags:Instance OR flagsEnum1.

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)