Next: Return Stack, Previous: Recursion, Up: Forth Tutorial [Contents][Index]
EXIT exits the current definition right away. For every counted loop that is left in this way, an UNLOOP has to be performed before the EXIT:
EXIT
UNLOOP
: ... ... u+do ... if ... unloop exit endif ... loop ... ;
LEAVE leaves the innermost counted loop right away:
LEAVE
: ... ... u+do ... if ... leave endif ... loop ... ;
Reference: Calls and returns, Counted Loops.