Get Enum label based on Enum value

HI, 

Here is the sample code useful to get the Enum label based on the passed enum value (which is integers)

int Mth,yearselected;

str Monyr;

DictEnum de;  

de = new DictEnum(enumName2Id(“MZK_MonthYear”)); //Enum Name

Mth = mthOfYr(today()); //need to get label for the value of current month

Monyr = de.index2Name(Mth);  //Passing the value to get the Enum 

Advertisements

One thought on “Get Enum label based on Enum value

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s