112
rated 0 times
[
116]
[
4]
/ answers: 1 / hits: 19183
/ 10 Years ago, fri, march 21, 2014, 12:00:00
I have a few arrays with like names.
ArrayTop[]
ArrayLeft[]
ArrayRight[]
ArrayWidth[]
I am trying to set the name dynamically in a function and then set value.
I have tried many ways of dynamically picking the right array but have not come up with a solution.
function setarray(a,b,c){
eval(Array+a+[b])=c
}
setarray('Top',5,100)
In this example i am trying to set.
ArrayTop[5]=100
More From » arrays