Back Home Next

Subchapters:

pr_format
pr_exec
pr_summary
Exercises programming

How to do programs?

To enter a short program or procedure from the keyboard, simply type .RUN. When the final END statement is encountered, execution of the main program will begin if no errors were found. If you entered only functions or procedures or if the main program you entered had an error, IDL will display the IDL prompt to show that a program is not running.


The .RNEW command compiles and saves procedures and functions in the same manner as .RUN. In addition, all variables in the main program unit, except those in common blocks, are erased.

        IDL>  test = 3.5
        IDL> .r
  - print,test
  - end
                    3.50000
        IDL> .go
                    3.50000
        IDL> .rnew
  - print,test
  - end
              % PRINT: Variable is undefined: TEST.
              % Execution halted at:  $MAIN$              1 /dev/tty

Usually, any text editor can be used to prepare programs or procedures of more than a few lines.
The GUI front-ends for IDL include built-in text editors, but these need not be used if you prefer to use your own text editor or word processor. Files containing IDL programs, procedures, and functions are assumed to have the extension name .pro. Once the program has been entered into a file from a text editor, run IDL and compile one or more program files using  .RUN or .RNEW.

 

IDL courses C. Morisset 2004 IA/UNAM V 2.2

Back Home Next