Re: Enum Names



I don't believe that you can. Enum is used to declare a type for
enumeration, so you can declare a data type of that enumeration, or you can
use any of the member names within your code, but you can't go the other
way. You may have many such types, all with a member value of 2, so which
would it return.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Goofy" <me@xxxxxxxx> wrote in message
news:ueFqOiO$GHA.4544@xxxxxxxxxxxxxxxxxxxxxxx
how can I retreive the string value of the enum internal identifier, in
other words if I have a value of 2 I want the corresponding "secondKey"


Public Enum MyEnum

firstKey = 1
secondKey = 2

End Enum




.



Relevant Pages

  • Re: mutually referential (Pg 140 K&R2)
    ... >> Forward declared struct and union tags are incomplete, ... You can't forward declare an enum ... the values of all the members of the enumeration. ...
    (comp.lang.c)
  • Re: enum safety
    ... 'Although variables of enum types may be declared, ... you declare declare a valid ...
    (comp.lang.c)
  • Re: Enum Names
    ... the enum groupname would be the way of resolving this. ... enumeration, so you can declare a data type of that enumeration, or you ... use any of the member names within your code, but you can't go the other ... other words if I have a value of 2 I want the corresponding "secondKey" ...
    (microsoft.public.excel.programming)
  • Re: Custom Attributes, Shared methods, Derived classes and reflection
    ... description associated with an enum value. ... enumeration value will give you the name as defined by the enumeration, ... Dim fi As FieldInfo = value.GetType.GetField ... Public Shared Function GetEnumValue ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Custom Attributes, Shared methods, Derived classes and reflection
    ... description associated with an enum value. ... enumeration value will give you the name as defined by the enumeration, ... Dim fi As FieldInfo = value.GetType.GetField ... Public Shared Function GetEnumValue ...
    (microsoft.public.dotnet.languages.vb)