CALL_FUNCTION
CALL_FUNCTION calls the IDL function specified by the string
Name
, 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.
Calling Sequence
Result = CALL_FUNCTION(
Name [, P
1
, ..., P
n
]
)
Arguments
Name
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.
P
i
The arguments to be passed to the function given by
Name
. 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.
Example
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)