Edit your hello_world.pro file so it contains
pro hello_world, number_questions ;+ ;pro hello_world ;Procedure to print ``Hello world'' to screen then ask 'Anyone there?' ;number_questions times. ; ;Parameters: number_questions - integer number of times to ask 'anyone there?' ;Keywords: none ;John Marsham, (01/11/06) ;- print,'Hello world' ;print the line ''Hello world'' to screen for i=1,number_questions do begin print,'Anyone there?' endfor stop; STOPS the program here end
Again type
.compile hello_worldthen
hello_world,3IDL stops at the stop command
% Stop encountered: HELLO_WORLD 17
Type
help,iThis tells you i is an integer and i=4. Similarly you can execute other commands now, such as
print,i i=i+1 print,ietc etc.
NowType
.con help,iIDL has continued (.con does this) and exited the procedure, so ``i'' is no longer defined. Using ''stops'' like this is very useful when you want to debug things, or just do a few plots from the command line etc.