next up previous contents
Next: Passing information into the Up: An Introduction to IDL Previous: Contents   Contents

Lecture -1: A first program

I've added this since I think people unfamiliar with any other programming languages can find lecture 1 confusing - I'll try and intergrate this with the later sections of the course better later.

From your home directory (use ``cd'' in UNIX). Open a file called hello_world.pro (use ``emacs'', ``xemacs'', ``vi'', or whatever you are familiar with). Put the lines below in this file. This is your first IDL procedure (it's traditional to start computing courses with a hello world program - and this one is no different).

pro hello_world
;+
;pro hello_world
;Procedure to print ``Hello world'' to screen
;
;No parameters 
;Keywords: none
;John Marsham, (01/11/06)
;-

print,'Hello world' ;print the line ''Hello world'' to screen

end

Note the first line states with pro then the filname (without the .pro). This is standard for IDL procedures. `;'' is a comment so ignored.

Enter idl (type ``IDL'' at the UNIX prompt)

Type

hello_world
The program should run.



Subsections

lecjm 2008-11-06