Perhaps a condition checking whether the ca.nameindex value is out of bounds?
if(ca.nameindex < 0 || ca.nameindex > ca.charnames.length - 1)
{
increment or decrement ca.nameindex respectively
}
else
{
out of bounds logic, maybe start at the highest val if decrementing, or vice versa to create a loop through the names
}
well looking at my info I don’t think I have gave enough info I have for example a string array with 5 names and index starts at 0 when I press the arrow gui buttons it increases to change the name to whats next in my string but when it gets to the last it gives me a error.