Hi @luishp,
if I create an array using this code
setvar [a] "x"
setvar [b] "y"
setvar [c] "z"
CreateArray [myArray] "[a],[b],[c]"
jsalert [myArray]
what I get is an array where the elements are "[a]", "[b]" and "[c]" and not as I expected "x","y" and "z".
Is this an intended behavior or an error in the CreateArray function?
One way to get the desired result is to create a type string
setvar [string] "[a],[b],[c]" and use
strParse "[string]" "," [myArray] or create an empty array and use arrayadditem with all elements.
Greetings
Rocco
Hi @luishp,
if I create an array using this code
setvar [a] "x"
setvar [b] "y"
setvar [c] "z"
CreateArray [myArray] "[a],[b],[c]"
jsalert [myArray]
what I get is an array where the elements are "[a]", "[b]" and "[c]" and not as I expected "x","y" and "z".
Is this an intended behavior or an error in the CreateArray function?
One way to get the desired result is to create a type string
setvar [string] "[a],[b],[c]" and use
strParse "[string]" "," [myArray] or create an empty array and use arrayadditem with all elements.
Greetings
Rocco