Try OpenEdge Now
skip to main content
ABL Reference
Class Properties and Methods Reference : UnsetFlag( ) method
 

UnsetFlag( ) method

Returns a flag enum instance with the indicated flag(s) unset.
Return type: Flag enum type
Access: PUBLIC
Applies to: Progress.Reflect.Flags enumeration, Progress.Reflect.ParameterMode enumeration, any user-defined flag enum type

Syntax

UnsetFlag ( INPUT flag AS flag-enum-type )
flag
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 vReflectFlag, an instance of Progress.Reflect.Flags, with only the Public flag set:
DEFINE VARIABLE vReflectFlag AS Flags.
vReflectFlag = Flags:Public.
vReflectFlag = vReflectFlag:SetFlag(Flags:Protected).

/* This unsets the Protected flag without affecting the status of
any of the other flags in vReflectFlag. */
vReflectFlag = vReflectFlag:UnsetFlag(Permission:Protected).
You can use a bitwise NOT operation to achieve the same result. For example, replacing the last line with vReflectFlag = vReflectFlag AND NOT Flags:Protected also unsets 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 Create and Delete flags set, and then uses UnsetFlag( ) to unset the Delete flag:
ENUM Permission FLAGS:
DEFINE ENUM None = 0
Read
Write
ReadWrite = Read,Write
Create
Delete.
END ENUM.
DEFINE VARIABLE vPerm AS Permission.

vPerm = Permission:Create.
vPerm = vPerm:SetFlag(Permission:Delete).

/* This unsets the Delete flag without affecting the status of
any of the other flags in vPerm. */
vPerm = UnsetFlag(Permission:Delete).

See also

SetFlag( ) method, NOT operator (bitwise), ToggleFlag( ) method