|
|
|||||||||||||||||||||
|
|||||||||||||||||||||
| 如何用函数名字符串来调用函数? |
| delphilxh |
| 比如我有一些函数(过程),我需要掉用他们,能不能通过函数名字符串来调用?有点儿象宏替换的意思! type {$M+} TMyObj = class published function CommandOne: Integer; function CommandTwo: Integer; function CommandThree: Integer; function CommandFour: Integer; end; {$M-} function DoCommand1(const Command: string): Integer; -- PS: A second method by V.Titov : uses type function DoCommand2(const Command: string): Integer; |