Compiling in IDL

Enter the directory with the files you plan to use.  Then open the IDL application by simply typing IDL at the unix prompt.  The IDL prompt will then appear:   (The bold type is what you )

~: cd myidl.dir
~/myidl.dir:
~/myidl.dir: idl
IDL>
There are several ways to compile, but the recommended one is to use is .RNEW.  The reason it is recommended is that .RNEW deletes all previous main program variables before compiling.  .RUN and .COMPILE are other commands that could be used (see Table 2-4 in Using IDL).

Be sure that your IDL programs all end with ".pro".  Then once your programs have been compiled, just type the name of the procedure (without the .pro) at the IDL prompt to execute.

For example, here's a simple program written in a text editor and entitled, simple.pro.

Pro simple

A = [3, 6, 9, 12]
B = [2, 4, 6, 8]

Plot, A, B

End

Here's what you do at the IDL prompt:
IDL> .rnew simple.pro
% Compiled module: SIMPLE.
IDL> simple
IDL>
 
 
A graph similar to the one shown at the right will also be displayed on your monitor.  However, the image will be approximately 5 x 5 inches and it will be white lines on black.  Just because the image is white on black on the monitor, it still comes out as black on white when printed or in PS files.
 

You don't have to save all your work in files.  You can simply type the command in at the IDL prompt, and they will execute.  The advantage is simplicity and ease of experimenting.  The disadvantage is that if you want to do the same thing again, you have to duplicate a bit of typing.

When you're done in IDL, just type exit to quit.