A reference to a flag enum instance. The enum type (flag-enum-type) of this instance must match the type of the instance the method is invoked on.
The following example results in vReflectFlags, an instance of Progress.Reflect.Flags, with the Public and Protected flags set:
DEFINE VARIABLE vReflectFlags AS Flags.
vReflectFlags = Flags:Public.
/* This sets the Protected flag without affecting the status of
any of the other flags in vAccess. */
vReflectFlags = vReflectFlags:SetFlag(Flags:Protected).
You can use a bitwise OR operation to achieve the same result. For example, replacing the last line with vReflectFlags = vReflectFlags OR Flags:Protected also sets the Protected flag.
Notes
This method is available for all built-in flag enums, and the compiler automatically generates it for all user-defined flag enums. For example, this code excerpt uses a user-defined Permission flag enum, initializes vPerm with the Read flag set, and then uses SetFlag( ) to set the Create flag, resulting in an enum instance with both the Read and Create flags set: