| 
       ToggleFlag ( INPUT flag AS flag-enum-type )
       | 
| 
       DEFINE VARIABLE vReflectFlag AS Flags.
        vReflectFlag = Flags:Protected. /* These two lines toggle the status of the Public and Protected flags without affecting the status of any of the other flags in vReflectFlag. */ vReflectFlag = vReflectFlag:ToggleFlag(Flags:Public). vReflectFlag = vReflectFlag:ToggleFlag(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 Permissions flag enum, initializes vPerm with the Read flag set, and then uses ToggleFlag( ) 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 Permissions flag enum, initializes vPerm with the Read flag set, and then uses ToggleFlag( ) 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 toggles the Create flag without affecting the status of any of the other flags in vPerm. */ vPerm = vPerm:ToggleFlag(Permission:Create). |