L
L.Peter
Dear Group,
i have a combobox and a button on a form.
the combobox has three values: stop, pause,start
when user press the button, the program will take apropriate action
at the momment, here is what i did
switch (choice)
{
case start: objGame.start
case stop: objGame.stop
case pause: objGame.pause
}
what i really want to be able to do is : (as methods may expand in the
future like restart, ...)
doaction(userchoice)
void doaction(string userchoice)
{
string str = "objGame."+userchoice;
//How to this
run str
}
TIA
L.Peter
i have a combobox and a button on a form.
the combobox has three values: stop, pause,start
when user press the button, the program will take apropriate action
at the momment, here is what i did
switch (choice)
{
case start: objGame.start
case stop: objGame.stop
case pause: objGame.pause
}
what i really want to be able to do is : (as methods may expand in the
future like restart, ...)
doaction(userchoice)
void doaction(string userchoice)
{
string str = "objGame."+userchoice;
//How to this
run str
}
TIA
L.Peter