next up previous contents
Next: A couple of exercises Up: Defining functions and procedures Previous: An example function   Contents

Scripts

Scripts just run as if you typed them in on the command line. Variables in a script are not local

I hardly ever use them (I often just cut and paste from the file). E.g. script_test.pro

print,'script_test'
for i = 0,10 do print,i

IDL> @script_test
script_test
       0
       1
       2
       3
       4
       5
       6
       7
       8
       9
      10
So, (script_test_wrong.pro)
print,'script_test'
for i = 0,10 do begin
  print,i
endfor
won't work (no conditional blocks allowed on the command line).



lecjm 2008-11-06