There are a couple of things that could be going wrong here. My guess is...
Things are coming unstuck because you are entering code at the IDL command prompt and there are statement BLOCKS - that is, there are blocks of IDL statements that are "bracketed" by BEGIN and END statements.
You cannot enter such a block at the command prompt, one line at a time. If you try then things go wrong - e.g., the freeze-up that you experienced.
It is possible to enter a moderately-sized block at the command prompt by entering all of its statements (including its BEGIN and END) in one line, using the "&" character as a statement separator. However, this is only good for "main-level" work.
My hunch is that you actually have the source code for an IDL procedure or function, and you are trying to use some of it at the command prompt. You would probably be better off making a proper procedure or function out of this code than fighting the command prompt with statement blocks. You should look up "Procedures and Functions" in the IDL online help to find out how to put one into a .PRO file & call it etc.
(My next guess is that you have this properly formatted but that TOTAL(IM) never reaches zero. If so then there is an error of reasoning in the WHILE block.)
|