in reply to An error message to understand

If the @CHOICE array was empty, the loop would never get executed. However, it is very likely that (at least) one of the elements of @CHOICE is undefined. Maybe you should show us a little bit more of your code.