Back Home Up Next

Subchapters:

Syntax

Special symbols:

; is the beginning of a comment.
& allows to put 2 commands on the same line.
$ allows to continue a command on the next line, or (when at the beginning of the line) will send command to the shell.  
@ will include a file containing a list of IDL commands (bach)
# and ## are matrix operators.
^ will allow you to redo a command from the history, asking you a string to match.
! is used for the system variables: IDL> print , !pi

The command and the different parameters are always separated by commas (with or without space around):

        IDL> print , 'I do not like to print!'
        IDL> print , 512. * 512. / 4.
        IDL> plot,x,y
        IDL> readf,logical_unit,x1,x2,x3,x4

The affectation of a variable is done by the sign =
The function have its parameters between braces.

        IDL> var1 = 5
        IDL> var1 = 5. ; no warning if var1 is already defined...
        IDL> a = cos(x)
        IDL> b = cos(x^2 + y^2) * alog(5*z^(1./3.))
        IDL> plot , x , cos(x^2)

Arrays elements are referred using [ ] or ( ) -this is the old fashion-.

        IDL> tab[2,6] = 6.

Be careful of the different ways IDL pass the parameters.

 

IDL courses C. Morisset © 2004 IA/UNAM V 2.2

Back Home Up Next