Welcome to the Exelis VIS product documentation center! Here you will find reference guides, help documents, and product libraries. Discover the products including ENVI, IDL, and ENVI LiDAR, and solutions developed by Exelis VIS at www.exelisvis.com.


EXECUTE

EXECUTE

The EXECUTE function compiles and executes one or more IDL statements contained in a string at run-time. EXECUTE is limited by two factors:

  • The need to compile the string at runtime makes EXECUTE inefficient in terms of speed.
  • The EXECUTE function cannot be used in code that runs in the IDL Virtual Machine.

Use of the EXECUTE function is not permitted when IDL is in Virtual Machine mode. The CALL_FUNCTION, CALL_METHOD, and CALL_PROCEDURE routines do not share this limitation; in many cases, uses of EXECUTE can be replaced with calls to these routines.

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.

Examples


Create a string that holds a valid IDL command and execute the command by entering:

com = 'PLOT, [0,1]'

void = EXECUTE(com)

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.

Syntax


Result = EXECUTE(String [, QuietCompile] [, QuietExecution])

Return Value


EXECUTE returns true (1) if the string was successfully compiled and executed. If an error occurs during either phase, the result is false (0).

Arguments


String

A string containing the command(s) to be compiled and executed. Multiple statements in the string should be separated with the “&” character. GOTO statements and labels are not allowed.

QuietCompile

If this argument is set to a non-zero value, EXECUTE will not print compiler generated error messages (such as syntax errors) to the console or IDL Output Log. If QuietCompile is omitted or set to 0, EXECUTE will output such errors.

QuietExecution

If this argument is set to a non-zero value, EXECUTE will not print error messages generated during execution to the console or IDL Output Log. If QuietExecution is omitted or set to 0, EXECUTE will output such errors.

Keywords


None.

Version History


Original

Introduced

5.2

Added QuietCompile argument

6.1

Added QuietExecution argument

See Also


CALL_FUNCTION, CALL_METHOD, CALL_PROCEDURE



Comments


This page has no comments yet. Be the first one!

© 2013 Exelis Visual Information Solutions