java for loop

Posted by roberto aranibar on
URL: http://imagej.273.s1.nabble.com/java-for-loop-tp3702431.html

I am a fairly experienced Matlab programmer, but I have no experience with
Java and all I want to do is write a simple macro that does a for loop in it
which renames all the ROIs in my ROI manager as

"a{the number of the roi in the list (i.e., "13" if its the 13th roi in the
list)}n"

this is what I have so far, but the macros > evaluate line command in the
imageJ text editor says that my integer i is undefined:

for(int i=1;i=roiManager("count");i++) {
roiManager("Select",i-1);
roiManager("Rename","a"i"n");
}

I'm also unsure about the syntax used to insert the integer i into my
string.

Can anyone help or point me to a good reference? Thanks so much, Roberto

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/