X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 23 May 2004 06:39 PM by  anon
"while (total(im) ne 0) do begin"....what is wrong with this code
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
23 May 2004 06:39 PM
    everytime i enter this line of code into IDL the program freezes up, and i dont know enough about the programming language to fix it..... can anyone tell me is it this section of code itself that is the problem, or is their likely to be a problem somewhere earlier in the code which is causing it to reject this particular section??? thanks.

    Deleted User



    New Member


    Posts:
    New Member


    --
    23 May 2004 10:54 PM
    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.)
    You are not authorized to post a reply.