Dynamic Enum

T

Todd Zetlan

I currently have an enum that looks like:

Protected Enum serviceEnum

UNDEFINED

LOGIN

TIME

INDEX

End Enum


I need to make it more dynamic and read the values from an XML file (instead of hardcoding as above). The
XML file structure will look something like:
<?xml version="1.0" encoding="utf-8" ?>

<company id="ABC">

<serviceIDS>

<serviceID>UNDEFINED</serviceID>

<serviceID>LOGIN</serviceID>

<serviceID>TIME</serviceID>

<serviceID>INDEX</serviceID>

</serviceIDS>

</company>


How can I go about doing this?
 
A

Armin Zingler

Todd Zetlan said:
I currently have an enum that looks like:

Protected Enum serviceEnum

UNDEFINED

LOGIN

TIME

INDEX

End Enum


I need to make it more dynamic and read the values from an XML file
(instead of hardcoding as above). The XML file structure will look
something like: <?xml version="1.0" encoding="utf-8" ?>

<company id="ABC">

<serviceIDS>

<serviceID>UNDEFINED</serviceID>

<serviceID>LOGIN</serviceID>

<serviceID>TIME</serviceID>

<serviceID>INDEX</serviceID>

</serviceIDS>

</company>


How can I go about doing this?


You can't. Enums are constants the compiler resolves. They are there for the
*programmer* not having to remember integer values.
BTW, plain/text is usually used in the usenet. BTW II, you've already posted
the question. :)


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top