CALL_FUNCTION calls the IDL function specified by the string
, passing any additional parameters as its arguments. The result of the called function is passed back as the result of this routine.
Although not as flexible as the
EXECUTE function, CALL_FUNCTION is much faster. Therefore, CALL_FUNCTION should be used in preference to EXECUTE whenever possible.
Result = CALL_FUNCTION(
Name [, P
, ..., P
A string containing the name of the function to be called. This argument can be a variable, which allows the called function to be determined at runtime.
The arguments to be passed to the function given by
. These arguments are the positional and keyword arguments documented for the called function, and are passed to the called function exactly as if it had been called directly.
The following command indirectly calls the IDL function SQRT (the square root function) with an argument of 4 and stores the result in the variable R:
R = CALL_FUNCTION('SQRT', 4)