Calling a method by name.

Lurker #5 lnumber5 at klassmaster.com
Tue Jun 26 19:28:31 PDT 2007


One more thing... How can I call a method by name? I was looking at the ClassInfo but I cant' find a way to call a method like this:

class Commands
{
  void command1() {}
  void command2() {}
  void command3() {}
}

Commands cmds = new Commands();
char[] cmd = readLine();
call(cmd, cmd);

Any ideas on how to implement this call() method?

Tnks


More information about the Digitalmars-d-learn mailing list