in reply to Can't "next" outside a loop block

next</next> in an iteration statement (<code>foreach, for or while) means that all further statements in the body of the loop are skipped and that the next iteration is started.

In the code snippet above there's no loop statement that I can see, so next doesn't make any sense semantically, and that's exactly what the interpreter is telling you.

Hope this helps, -gjb-