Calling method by name.

%u fghf at jhgjhb.com
Wed Feb 2 09:55:37 PST 2011


I know is possible to create an object from its name. It's possible to
call a method from that object if the name is only known at runtime?

Would something like the following be possible?

string classname, methodname;
// Ask the user for class and method.
auto obj = Object.factory(classname);
invoke(methodname, obj, param1, param2);

Thanks


More information about the Digitalmars-d mailing list