Login  Register

Re: "break" equivalent in Macro language.

Posted by Michael Schmid on Dec 07, 2010; 9:35am
URL: http://imagej.273.s1.nabble.com/break-equivalent-in-Macro-language-tp3686262p3686269.html

Hi Ved,

it is easy to break a loop without a break statement, e.g.:

for (i=0, i<100; i++) {
   do something, set 'end_reached' if we should break
   if (end_reached) i = 1e99; //break
}

Michael
________________________________________________________________

On 7 Dec 2010, at 05:24, Ved Sharma wrote:

> Hello,
>
> As most of you already know that "break" statement is used in JAVA  
> to exit a loop (e.g. a for loop). It seems to me that it is not  
> recognized in ImageJ's Macro language. Is there some other  
> statement/code I can use in my macro in place of "break"?
>
> Ved