It's a kind of bug.

Despite what the manual appears to say, you should always use a value with Exit (and Quit).

The problem is that the parser has been known to exhibit odd behaviour when there is no value - it swallows the next token/keyword which is probably your EndIf.

This means that your If statement is now badly constructed and the parser has a hell of a job working out what is going on.

In short - always supply a value for Exit and Quit - there is no good reason not to.

This feature lead to the infamous "Exit Exit" kludge [Wink]