If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Get Enum Index Value??

Is it Possible to get the "Index Value" or position from an Enum?

There are no apparent properties of a defined ENUM only the individual elements. I know I can assign my Enum Values to an Array (one by one) and index through Them, but I was hoping to be able to directly access the elements of the Enum by index.

Optionally is there a nice clean way to assign the Enum to an Array?

Regardless of the Array Style (Dynamic / Static) ,Variable Type, or initialization state I can't seem to be able to assign the values without Looping Through each element. I've tried assigning the array to the Enum definition and a defined variable of the enum. Nothing works, which then of course makes me question the value of the Enum over individual constant declarations, aside from the Intellisense popups. So I come back to the conclusion that I'm missing something in regards to Enum usage. Any insight would be appreciated.

Re: Get Enum Index Value??

If you are creating Collection of your own class Then you can include addtional element as key in your class and use that property as key for add function in your collection. Make sure you are not sending duplicate value to this property. you can use this key for accessing elements of collection. Note: Key should be String type.
If you understand how this works you can modify remove method of collection to handle duplicate values also