http://imagej.273.s1.nabble.com/returning-array-from-a-function-tp5005495p5005500.html
> I have tried to modify an array in a function, so i wrote this macro and
> function:
>
> macro "func_test" {
> n=3;
> m=6;
> mtx=newArray(1,2,3,4);
> appl(n,m, mtx);
>
> Array.print(mtx);
> k=mtx[4];
> print(k);
> }
>
>
> function appl(a,b, mtx) {
>
> Array.print(mtx);
> mtx=Array.concat(mtx, n);
> Array.print(mtx);
> mtx=Array.concat(mtx, m);
> Array.print(mtx);
>
> return mtx;
>
> }
>
>
> What I expected is that the array mtx would contain 1, 2, 3, 4, 3, 6 after
> the function was executed. Instead, I saw that the array was printed from
> the function as i expected, but the returned value contained the original
> values only. And I was also unable to acces the array position 4 (mtx[4]),
> and i got a massege thet it was out of range (0-3).
> I have searched the net for a solution for 2 whole days and i have fount
> nothing that could explain this annoying behaviour of the function.
>
> PLEASE, PLEASE, PLEASE HELP MEEEEE!
>
> How is it possible to return the modified array, and how can i access the
> new values at the end of the array??????
>
> Many thanks in advance!
> Csaba
>
>
>
>
> --
> View this message in context:
http://imagej.1557.x6.nabble.com/returning-array-from-a-function-tp5005495.html> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>