This is an array of strings, not a simple variable. The array has NUMPISTONFUNCTIONS elements.
From your debug screenshot, we can see that numpistonfunctions = 24, so the array pistonFunctionText() can hold up to 24 elements.
From your debug screenshot, we can also see you are trying to reference element number pinFunc, where that value is 99. Since that is larger than the number of elements in array pistonFunctionText() – that is 99 is greater than 24 – you get an OutOfBoundsException.
Technically, since array element are numbered from 0, when you have 24 elements they are number 0 to 23. So accessing element 99 is higher than 23. If you tried accessing element index 24 it would also be out of bounds.
I have no idea what you are trying to do or why pinFunc is 99 but NUMPISTONFUNCTIONS is 24. But that is the crux of your problem.