G
giant food
This seems like a long shot, but I wondered if there's a way to loop
over the values in an Enum. For example, say I have an Enum as
follows:
Public Enum statusValues
Ready
Running
Finished
Error
End Enum
'.....
I'd like to be able to loop over and print out these values' names
something like this:
For Each item in statusValues
Console.WriteLine(item.ToString)
Next
....the reason being that, if I add elements to my Enum object, I won't
have to go change the code that prints out their names. Thanks!
--Frank
over the values in an Enum. For example, say I have an Enum as
follows:
Public Enum statusValues
Ready
Running
Finished
Error
End Enum
'.....
I'd like to be able to loop over and print out these values' names
something like this:
For Each item in statusValues
Console.WriteLine(item.ToString)
Next
....the reason being that, if I add elements to my Enum object, I won't
have to go change the code that prints out their names. Thanks!
--Frank