Hello, could you please elaborate or even better if I can trouble you to provide example how one can implement "add to array" in SDK 1.2.x?
Also, indexOf() is quite necessary.
From what i see only size() is supported.
Thanks,
Igor.
function myAdd(curArray,newValue) { var curSize=curArray.size(); var newArray=new [curArray.curSize+1]; for(var i=0;i<curSize;i++) {newArray[i]=curArray[i];} newArray[curSize=newValue; return newArrray; } // called with array=myAdd(array,value);
You could run into watchdog issues if curSize is large.
Like flowstates says, walk the array, but you may want the first, last, or all that are the same, and based on what's in the array you may want to use = instead of equals().
So for an array of Numbers/floats where you want the first occurance:
function myIndexOf( array, value) { for(var i=0;i<array.size();i++) { if(array[i]==value) {return i;} } return null; }