Skip to main content

1.5) A First Program


Traditionally, when learning a programming language, your first task is to write a program which prints 'Hello World' to the screen.

In a new shell, change into your "IDL_course" directory and start IDL. In another shell, also in your IDL_course directory, use a text editor to open a file called hello_world.pro. Put the lines below into this file.

print, 'Hello World'
END

Note that you always need and "END" at the end of an IDL program.

In the other shell, at the IDL prompt, enter the following text to run the program.

.r hello_world

The program should run, printing "Hello World" to your IDL screen.