| 
       SetFlag ( INPUT flag AS flag-enum-type )
       | 
| 
       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). | 
 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:
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:
  | 
       ENUM Permission FLAGS:
        DEFINE ENUM None = 0 Read Write ReadWrite = Read,Write Create Delete. END ENUM. | 
| 
       DEFINE VARIABLE vPerm AS Permission.
        vPerm = Permission:Read. /* This sets the Create flag without affecting the status of any of the other flags in vPerm. */ vPerm = vPerm:SetFlag(Permission:Create). |