Calling a method [like a function pointer]

Dar Scott dsc at swcp.com
Sat Jun 12 15:10:52 EDT 2004


On Jun 12, 2004, at 12:38 PM, K wrote:

> Okay I have tried value() after 1000 or so calls function suddenly get 
> cannot evaluate methods and variables that it previously executed (as 
> stated in my posting reguarding value()).  Is there a way to invoke a 
> function by name and retrieve it's return value other than value() 
> since it has significant anomalies?  This is simular to calling a 
> function pointer in C++ or CallByName() in Visal Basic.

No function pointer.  However, there are other alternatives.

The functions merge() & value() and commands 'do', 'call' & 'send' all 
evaluate and might be useful.  There are ways to execute commands in 
the first and functions in latter.  Besides using function names, you 
can also create expressions and evaluate those in the appropriate 
context.

You can return values from a 'send' (not in time) by using return in 
the callee and looking at result() in the caller.

Dar Scott



More information about the use-livecode mailing list