Just cast the integer value to your enum value. example
enum length
{
metres = 0,
centimetres = 1,
millimetres = 2
}
//in the method
public void test()
{
length x = length.centimetres;
int a = (int) x; // a becomes 1;
int b = 0;
length y = (length) b; // y becomes length.metres
}
hth
Fitim Skenderi
"Luke Smith" <lu**********@SPAMbtinternet.com> wrote in message
news:OB**************@TK2MSFTNGP11.phx.gbl...
i have the following
enum length { metres = 0, centimetres, millimetres }
By knowing the integer (0, 1 2 ....) how do i obtain the name (metres,
centimetres....)??
thanks
--
//remove SPAM to reply by email