Re: continue equivalent on macro language (for loop control)
Posted by
Rasband, Wayne (NIH/NIMH) [E] on
Sep 29, 2013; 4:34am
URL: http://imagej.273.s1.nabble.com/Re-continue-equivalent-on-macro-language-for-loop-control-tp5004972.html
On Mar 15, 2011, at 6:13 PM, Carnë Draug wrote:
> Hi everyone,
>
> is there any equivalent to 'continue' in a for loop in the macro
> language? I'm inside a foor loop and want to skip to the next value in
> the loop if a certain condition is not meet. Here's a bit of code
> example
>
> // get list of files and options
>
> for (i = 0; i < lengthOf(file_list); i++) {
> // check if file exists before opening. Skip if it's no longer there
> if(File.exists(file_list[i]) {
> file.open(file_list[i]);
> } else {
> print ("File disappeared. Skipping");
> continue;
> }
> // Do very smart image analysis here
> }
>
> I tried continue and it doesn't work. "next" also doesn't. Any help
> would be appreciated.
ImageJ 1.48d adds support for 'continue' and 'break' statements to the macro language.
-wayne
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html