substitution variable

D

DanielG

Hello,

How is it possible to implement this behavior:

- the main program reads at the beginning an XML file and it builds a
hashtable with key, value pairs.
e.g. <entry key=Price value=SpecialDouble />
- there is a class, too called XYZ that has some static members, one
of them is SpecialDouble.
- in the code I want to instantiate an object XYZ.SpecialDouble (or
other possible values ; there are a finite number of possibilities,
just 5) for the key=Price.

I don't like the idea to write a huge if() if() if() ...

Thank you very much for any hint,
DanielG
 

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

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top