Accessing array index through the result of a string concatenation
I was hoping someone could assist me with the following problem.
I am fundamentally calling a method from another class through the use of an object. And this method has an input paramater which is a string.
so like this,
statusTest.value.setName(...), where ... is a string.
Within the call, i am passing a string value through an index of an array,
where statDetails is an array i have declared and initialised earlier.
My problem is, I also have an array declared statDetailsCool that i want to use in the same fashion but only in certain circumstances.
So i want to do something like the following,
where anotherArray has been declared and initalised and contains "Cool" in its first index.
The compiler views this as a string usage rather than an array as it expects.