Login  Register

handling arrays in macro

Posted by Lucas, Falk /BDF HAM on Jul 18, 2006; 5:48pm
URL: http://imagej.273.s1.nabble.com/handling-arrays-in-macro-tp3702124.html

Hi,

is there any limitation in handling of arrays in the macro language???

I tried to call a function with 2 parameters, a number and an array,
which should return the array again.

FileArray=newArray(5);
...

FileArray=check_array(i,FileArray);

check_array(i,Array){
        if (i>Array.length-1){ //error message
                //create new temporary array
                temp= newArray(Array.length);
                temp= Array;
                //extend array size by 1
                Array= newArray(temp.length+1);
                //copy info from temp array
                for (x=0; x<temp.length; x++){
                        Array[x]= temp[x];
                }
        }
  return Array;
  }

This should extend the array dynamicly.

But I get an error message: Array expected at Array.length



Falk


_____________________  Confidentiality  ______________________

This electronic transmission is strictly confidential and intended
solely for the addressee.  It may contain information which is covered
by legal, professional or other privilege.  If you are not the intended
addressee, you must not disclose, copy or take any action in reliance
of this transmission.  If you have received this transmission in error,
please notify us and delete the received data as soon as possible.

This footnote also confirms that this email message has been swept
for the presence of computer viruses.
_______________________________________________________