What is the difference between the code bellow
' no Flags'
Public Enum MyEnum
Monday = 1
Tuesday = 2
Wednesday = 4
Thursday = 8
End Enum
and
<Flags()> _
Public Enum MyEnum
Monday = 1
Tuesday = 2
Wednesday = 4
Thursday = 8
End Enum
I do the
Dim days As MyEnum = MyEnum.Monday Or MyEnum.Tuesday Or MyEnum.Wednesday
If (days And MyEnum.Tuesday) = MyEnum.Tuesday Then
Console.WriteLine("Tuesday OK") ' here'
Else
Console.WriteLine("Tuesday NOK")
End If
If (days And MyEnum.Thursday ) = MyEnum.Thursday Then
Console.WriteLine("Thursday OK")
Else
Console.WriteLine("Thursday NOK") ' here'
End If
and obtain the same result in both cases(with or without FlagAttribute).