convert a string to an array to use with dict (replace)
hello,
i have a input list as symbol : " 1 2 3 4 5 6 7 8 9 10"
I m trying to store it as an array [1,2,3,4,5,6,7,8,9,10] in a dict with js, but it only store is as symbol.
The max object object store it as an array with the message to a dict:
sprintf replace mymaster::mysub %s (where %s is the list as symbol)
In js, im trying to use the same process,
var myDict = new Dict
myDict.replace("mymaster::mysub", I need the array here);
.. i tried to convert as an array, but i miss something.
any help?
thx!
the max object version
answer for myself
var newList = incomingList.toString().split(" ");
..and this is stored as an array. I kinda wonder why i need to convert to string as it comes in as a symbol. It's not super intuitive. Anyways, seems to work.
my string wasn't formated the right way so i had to convert it
var newList = incomingList().split(" ").map(function(num)
{return parseFloat(num,1);
}
)