My problem is that even if I DIM the array (DIM $array[10]), if I populate it with only one entry ($array = "element1"), I still encounter the same problems.
The only good workaround I've come up with is to tag a blank element onto the array ($array = "element1", ""), then wrap the contents of the FOR EACH with an IF:
Code:
FOR EACH $element IN $array
IF $element
? $element
ENDIF
NEXT
Which is pretty ugly and a hassle.....