Iterate through enum


How do i do this?

I found a method, System.Enum::GetNames(Type enumtype) that returns a string array, but i dont get how to set the argument.

i tried with System.Enum::GetNames(typeof(MyEnum)); but thats wrong,

Any sugestions?

Thanks in advance


The following code will print all enum values of enum type “TestEnum”…

static void EnumIteration(Args _args)
DictEnum DEnum;
int i;
DEnum = new DictEnum(enumName2Id(“TestEnum”));
for (i=0; i < DEnum.values(); i++)
print DEnum.index2Label(i);


Thanks Arun!

Is it necessary that all enums are indexed from 0 to size of enum?