Login  Register

Re: continue in if

Posted by Bill Christens-Barry on Apr 02, 2007; 10:39pm
URL: http://imagej.273.s1.nabble.com/save-summary-file-tp3699878p3699882.html

Chris,

You can do this:

for (i=1; i<=8; i++){
    if(i<>5)
        print(i);
}

Bill Christens-Barry


On Mon, 2 Apr 2007 15:54:45 -0400, Colin Sturm <[hidden email]> wrote:

>Is there a way to continue to the next iteration of a for loop if a
>criteria is met?
>I tried using continue; but didn't work.
>
>Ex:
>for (i=1; i<=8; i++){
>    if(i==5)
>          continue;
>    print(i);
>}