Posted by
L'assegnista on
Jan 10, 2021; 12:04am
URL: http://imagej.273.s1.nabble.com/Filling-an-Array-from-within-a-user-defined-function-in-Macro-Language-tp5024345.html
Dear List,
I have a long macro that I tried to simplify using a function.
The main purpose of this function was to fill a series of arrays that I'd
like to save at the end of the macro.
However I saw that arrays are not filled within functions and I was
wondering if this could be possible. I have very little knowledge of
programming in general ( as you could have already understood!)
Here a quick example that demonstrate what I would like to do
Array1=newArray();
Array2=newArray();
for (i=0;i<5;i++){
Array1=Array.concat(Array1,i);
}
function Array_fill(n){
for(i=0;i<n;i++){
Array2=Array.concat(Array2,i);
}
}
Array_fill(5);
print("Array1 length: "+Array1.length);
print("Array2 length: "+Array2.length);
Thank you very much
Federico
--
Federico Luzzati, PhD
Assistant Professor
University of Turin,
Dept. LIfe Sciences and Systems Biology (DBIOS)
Via Accademia Albertina, 13 - 10123 Torino - IT
Researcher at
Neuroscience Institute Cavalieri Ottolenghi (NICO)
Regione Gonzole, 10 - 10043 Orbassano (To) - IT
tel. +39-0116704683/ -6631
http://www.nico.ottolenghi.unito.it/index.php/it/adult-neurogenesisSostieni con il tuo 5xmille il NICO e la ricerca sulle malattie
neurodegenerative
Firma nel riquadro "Finanziamento della ricerca scientifica e
dell'Università"
CF 97564560015
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html