This page is being rewritten from a Unix page to an IDL page.
Declarations/Variables
Procedures/Functions
Control flow
Input/Output
Array handling
Command | Description |
a = 1 b = 2.5 c = 1.3D0 d = fltarr(100) e = fltarr(10,10) index = indgen(50) f = replicate(2.5, 100) g = 'mytext' h = make_array(3,4,/integer,value=5) |
create an integer with value 1 create a real with value 2.5 create a double real with value 1.3 create reall array create real 2D aray create integer array with values [0.....49] create real array with value 2.5 create string create 2D integer array with value 5 |
IDL programs are best constructed in a modular fashion using procedures or functions. The filename under which a procedure/function is saved must be the name of the procedure/function with the extension .pro.
Input/Output
Array handling
Command | Description |
a = b[1,5] a = b[1,*] a = b[6:10] a[2:7] = b[6:10] indx = sort(b) $ a = b(indx) indx = where(b gt 0,c) $ a = b(indx) |
select one element second row 5 element part move section from b to a sort b into a a = part of b > 0 |