Environment > Projects > Running Projects

# Running IDL Projects

Running an IDL Workbench project is the process of executing a single routine designated as the Run Command. Other routines called by the routine being run are located, compiled, and run using IDL’s built-in mechanisms for resolving and executing routines.

You can modify an IDL Workbench project’s properties on the IDL Project Properties page of the Project Properties dialog. See IDL Project Properties for a detailed description of each project run property.

## Resetting the Session

If you select the Execute .RESET_SESSION before running project property, IDL executes the .RESET_SESSION executive command before executing the Run Command. Resetting the session ensures a “clean” IDL environment for the project run; all data variables and compiled routines are removed from memory before the run begins.

Tip: One of the reasons to reset the session before running your project is to ensure that all `.pro` files are recompiled to reflect any changes you have made in the source code. If you prefer not to reset the session, consider setting the Enable compile on save preference on the Editor page (there is also a link to this preference on the IDL Project Properties page). This will cause IDL to recompile `.pro` files each time you save, ensuring that the routine in IDL’s memory reflects any recent changes to the source code.

## Building the Project Before Running

If your goal in running your project is to test the application that will be built by the project build action, select the Build project before running result property. This causes IDL to build the project as if you had manually invoked the build command before executing the Run Command.

## The Run Command

The Run Command is a single routine used to launch the project application. It can be any IDL command or routine, although it is usually the name of a single procedure. This is the command executed when you select the Run > Run Project menu item or toolbar button.

In the most common scenario, an IDL application consists of multiple .pro files containing different routines. The application is launched when a specific routine (designated as the Run Command in the context of running a project) is invoked; as the commands in that routine are executed, IDL searches for and compiles any additional files that may be required.

## Compiling a File Upon Save

Executing the Run Command does not force IDL to recompile all routines in the project (unless the Execute .RESET_SESSION before running project option is selected). As a result, changes to code for routines that have been previously compiled are not automatically incorporated when the project is run. Instructing IDL to automatically recompile files when you save them avoids this situation.

To force IDL to compile files when you save them, set the Enable compile on save preference on the Editor page.