www.delorie.com/gnu/docs/gforth/gforth_33.html   search  
 
Buy GNU books!


Gforth Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.21 Leaving definitions or loops

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:

 
: ...
 ... u+do
   ... if
     ... unloop exit
   endif
   ...
 loop
 ... ;

LEAVE leaves the innermost counted loop right away:

 
: ...
 ... u+do
   ... if
     ... leave
   endif
   ...
 loop
 ... ;

Reference: 5.8.5 Calls and returns, 5.8.3 Counted Loops.


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003