running macro loop

Posted by stevenbrookes on
URL: http://imagej.273.s1.nabble.com/running-macro-loop-tp5012832.html

Hi,
I have a block of macro code that I want to loop so long as the current slice number is less than th number of slices in the stack. I thought this would work but it doesn't:

while (getSliceNumber()<nSlices)
{
MACRO CODE HERE
}

When I select the block and run it has a selection it loops fine; just not as part of the whole macro.

I'd be grateful for any ideas as to what I'm doing wrong


Steve