IsFlagSet( ) method

Indicates whether the enum instance has the specified flag(s) set.

Return type: LOGICAL

Access: PUBLIC

Applies to: Progress.Lang.FlagsEnum class

Syntax

IsFlagSet ( INPUT flags AS Progress.Lang.FlagsEnum )
flags
A reference to a Progress.Lang.FlagsEnum instance with one or more flags set. A runtime error will be generated if the underlying value of flag is 0. See the Notes for more information.
This method, invoked on thisInstance, is equivalent to evaluating the following expression:

(thisInstance AND flags = flags)

This means that if flags has multiple flags set, the method returns TRUE only if all the flags in flags are set in the enum instance. For example:
ENUM Permission:
     DEFINE ENUM None = 0
                 Read
                 Write
                 ReadWrite = Read,Write
                 Create
                 Delete.
END ENUM.
DEFINE VARIABLE myPermission AS Permission NO-UNDO.
DEFINE VARIABLE lRret        AS LOGICAL    NO-UNDO.

myPermission = Permission:Read.

/* Returns TRUE. */
lRet = myPermission:IsFlagSet(Permission:Read).

/* Returns FALSE because Write is not set in myPermission. */
lRet = myPermission:IsFlagSet(Permission:ReadWrite).

/* Returns FALSE because the method is passed both
   the Read and Write flags because of the bitwise OR,
   but Write is not set in myPermission. */
lRet = myPermission:IsFlagSet(Permission:Read OR Permission:Write).

Notes

See also

ENUM statement