a method to create all values

lion8420

Member
Joined
Sep 11, 2012
Messages
11
Programming Experience
1-3
It may be because it is late or maybe I cant wrap my brain around this.

I have created a class with 4 enumerations in it. Each enumeration has 3 values.

I am trying to find a way to create a list of all the possible unique combinations.

I have tried a nest for each loop but I am missing something here. This isn't for a class this is just a learning project for myself. I would appreciate a jump start with this. Thanks
 
Hi,

This is easy enough to do. As you have guessed you need to use Nested For Loops, four to be exact, being one for each of the Enumerations that you have got. To then get the Names of each of the elements in each of the enumerations you then need to use the GetNames method of the Enum Class. Here is an example:-

For Each myColor As String In [Enum].GetNames(GetType(CustomColor))


In this case "CustomColor" is an Enumeration.

Hope that helps.

Cheers,

Ian
 
Back
Top