| 
       IsFlagSet ( INPUT flags AS Progress.Lang.FlagsEnum )
       | 
| 
       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). | 
 The method raises error if the two enum instances are not the same type.
The method raises error if the two enum instances are not the same type.
   Because IsFlagSet() cannot be passed an enum instance with an underlying value of 0, you must check for that case before using the method, using the EQ (=) or NE (<>) operators or the Equals() method, for example. Using the Permission enum from above, the following example checks that the user's permission level, myPermission, matches the permission level needed, neededPermissions, to perform an operation. The code checks to make sure neededPermissions is not Permission:None first, before invoking IsFlagSet():
Because IsFlagSet() cannot be passed an enum instance with an underlying value of 0, you must check for that case before using the method, using the EQ (=) or NE (<>) operators or the Equals() method, for example. Using the Permission enum from above, the following example checks that the user's permission level, myPermission, matches the permission level needed, neededPermissions, to perform an operation. The code checks to make sure neededPermissions is not Permission:None first, before invoking IsFlagSet():
  | 
       DEFINE VARIABLE neededPermissions AS Permission NO-UNDO.
        DEFINE VARIABLE myPermission AS Permission NO-UNDO. ... myPermission = Permission:Read. IF (neededPermissions NE Permission:None) OR (NOT myPermission:IsFlagSet(neededPermissions)) THEN MESSAGE "You do not have permission for this operation.". END. |