Hi,
I have the following Enum:
Public Enum myEnum As Integer
first = &H1
second = &H2
third = &H4
fourth = &H8
fifth = &H10
sixth = &H20
End Enum
It is neccessary, unfortunately, that the enum elements have those values, or at least have values that can be binary compared.
I have a class which can be set during construction to be one of two types, a type with values relating to first through fourth, and a second type with values relating to first through sixth.
I would like to use a For loop to iterate through 1-4 or 1-6 elements of the enum, but I have found that this code:
For enumType as myEnum = myEnum.first to myEnum.fourth
Next
iterates through {1,2,3,4,5,6,7,8} and not through {1,2,4,8}.
This is not ideal.
Obviously I can code around this issue, but I can see a scenario where that workaround could be easily missed in maintenance programming, and I'm hoping someone can recommend a simple solution that won't break if, for example, the values in the enum have to change at a later date.