in reply to Array issue

In the code you posted, it looks like you didn't close the last IF statement with a curly brace. The WHILE is closed, but not the IF. (I guess really, the closing brace looks like the close for the IF which leaves the WHILE un-closed.)

(so many nodes and so little time ... )