The EXECUTE function compiles and executes one or more IDL statements contained in a string at run-time. It also returns true (1) if the string was successfully compiled and executed. If an error occurs during either phase, the result is false (0).
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.
Create a string that holds a valid IDL command by entering:
Execute the contents of the string by entering:
A plot should appear. You can confirm that the string was successfully compiled and executed by checking that the value of R is 1.