It would be nice if WinRunner could use delegates/pointers and I've been trying to figure out how, but have not been able to find anything on this. I've tried searching through QAForums and mercurys support site and didn't see anything on it.
Here is some sample code to give you an idea of how I might implement this.
public function ProcessMethod(in strMethod)
You are close. The 'strMethod' variable is a scalar string and not a function.
If you want to define the contents of res to be the same as strMethod, you only need to do this in the function:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">res = strMethod;</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Now, if you are wanting to execute a function that is called the same as the strMethod value you pass, then you need to look into the eval command. This command will allow you to build a dynamic string that represents the line of code you would like to execute. It would then build the line based on the information passed.