An enumeration can be decorated with the https://learn.microsoft.com/en-us/dotnet/api/system.flagsattribute[FlagsAttribute] to indicate that it can be used as a https://en.wikipedia.org/wiki/Bit_field[bit field]: a set of flags, that can be independently set and reset.
allows to define special set of days, such as `WeekDays` and `Weekend` using the `Or` operator:
[source,vbnet]
----
<Flags()>
Enum Days
' ...
None = 0 ' 0b00000000
Weekdays = Monday Or Tuesday Or Wednesday Or Thursday Or Friday ' 0b00011111
Weekend = Saturday Or Sunday ' 0b01100000
All = Weekdays Or Weekend ' 0b01111111
End Enum
----
These can be used to write more expressive conditions, taking advantage of https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/operators-and-expressions/logical-and-bitwise-operators#bitwise-operations[bitwise operators] and https://learn.microsoft.com/en-us/dotnet/api/system.enum.hasflag[Enum.HasFlag]:
[source,vbnet]
----
Dim someDays = Days.Wednesday | Days.Weekend ' 0b01100100
Consistent use of `None` in flag enumerations indicates that all flag values are cleared. The value 0 should not be used to indicate any other state since there is no way to check that the bit `0` is set.
* https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/operators-and-expressions/logical-and-bitwise-operators#bitwise-operations[Logical and Bitwise Operators in Visual Basic]