Posted by
Joachim Wesner on
URL: http://imagej.273.s1.nabble.com/macro-creating-n-Arrays-within-a-for-loop-tp3688201p3688203.html
>> name = "test " +i;
>> name = newArray(k);
>Maybe because you are trying to make a variable name that contains a
space.
>Try removing it.
No, this will only create a new Variable called "name" of type Array, the
old string variable "name" will be discarded!
As long as there is no "execute" statement in the ImageJ Macro language
(Hint! Hint!), that really RE-interprets a string as a new command
(however, if I´m not mistaken here, you would need thsi also in all places,
where you need to access one the the multiple arrays,
not only when creating those) you are somewhere out of luck.
Johannes,
What I would do in such cases, if you already know the number of "arrays" n
outside the loop (can still be a dynamic value that is read from
somewhere on runtime, you could create an array of n-times the single size
and use a variable offset in that array.
(Maybe this is basically what you did?)
Cheers
Joachim Wesner
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit
http://www.messagelabs.com/email
______________________________________________________________________