Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to retrieve enumeration items names?

Status
Not open for further replies.

vladk

Programmer
May 1, 2001
991
US
Hi,

Is it possible to get the very names instead of the values from enumeration?

For example:

Public Enum enmCount
zero
one
two
three
End Enum

And I would like to get the very word "one", not 1. I am interested if this is possible via the access to the "memory" or some APIs. Sounds a bit crazy; enumeration was not devised to be used in such a way, but I am quite interested.


Thanks

vladk
 
Yes. It is possible (with some minor restrictions). I figured out a way to do it a couple of years or so ago, and posted the method in this forum. Let's just do a quick keyword search ... hmmm ... can't find my generic solution at the moment, but here's an example specific to a particular ADO library, but it isn't hard to modify it

thread222-635114
 
Hi, strongm!

Thank you for such a great lesson! I was able to reproduce your example for standard enumerations, but I still quite puzzled how to make it work for the custom enumeration. I understand, it works for standard enums, but how to make it work for the custom one?

Thanks!

vladk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top