The EXECUTE function compiles and executes one or more IDL statements contained in a string at run-time.
| Warning |
Like the CALL_PROCEDURE and CALL_FUNCTION routines, calls to EXECUTE can be nested. However, compiling the string at run-time is inefficient. CALL_FUNCTION and CALL_PROCEDURE provide much of the functionality of EXECUTE without imposing this limitation, and should be used instead of EXECUTE whenever possible.
Result = EXECUTE(String [, QuietCompile] [, QuietExecution])
EXECUTE returns true (1) if the string was successfully compiled and executed. If an error occurs during either phase, the result is false (0).
A string containing the command(s) to be compiled and executed.
If this argument is set to a non-zero value, EXECUTE will not print the compiler generated error messages (such as syntax errors). If QuietCompile is omitted or set to 0, EXECUTE will output such errors.
If this argument is set to a non-zero value, EXECUTE will not print error messages generated during execution. If QuietExecution is omitted or set to 0, EXECUTE will output such errors.
None.
Create a string that holds a valid IDL command and execute the command by entering:
com = 'PLOT, [0,1]' void = EXECUTE(com)
Introduced: Original
QuietCompile argument: IDL 5.2
QuietExecution argument: IDL 6.1
Execute the contents of the string by entering:
R = EXECUTE(com)
A plot should appear. You can confirm that the string was successfully compiled and executed by checking that the value of R is 1.
Introduced: Original
CALL_FUNCTION, CALL_METHOD, CALL_PROCEDURE