Command Line
While the IDL command line is not a type of program, it is an effective tool for programmers. Using the command line, you can execute IDL statements one at a time. This interactive mode allows you to test code immediately. You can accomplish a variety of tasks from the command line, from printing the result of a computation to displaying a plot.
The command line has access to all variables available in IDL's current scope. For example, once you define variable a, you can use that same variable in the commands you type at the command line, until you manually change the value of a. (See also Scope.)
Note
If a program has stopped running, the current scope of the command line is not necessarily the main scope, but the scope of the program where it stopped. All the variables in that scope are now accessible to the command line. To return control and scope to the main level, enter the RETALL command.
You cannot include loops and other flow control methods on the command line in the same way as in a compiled program. Each line must be an executable IDL statement.
Examples
The following examples range from simple print commands to more complex computations and plots. Just click the blue example code to execute it in IDL. To run your own commands, just type them at the IDL command line and press Enter.
Example 2
Example 3
Example 4
Example 5
To display data in the iPlot tool, you can use the same data as the previous example, but substitute the PLOT command with IPLOT:
IDL displays the data in an iPlot window, where you can manipulate the data display using the graphical interface:

IDL iTools are explained in more detail later in this tutorial (See iTools).

