home .. forth .. colorforth mail list archive ..

[ColorForth] How to escape from loops


Hello,

I can't seem to figure out how to escape from a FOR loop properly if some 
exceptional condition occurs. I want to write something like this:

: loop for cond? if default next ; then exception ;

After "exception" has been executed, the loop should terminate. I guess I have 
to shuffle the return stack a bit for this to work, but I don't know how. 

Can anyone give me a hint?

Cheers,

	Alex
------------------------

To Unsubscribe from this list, send mail to Mdaemon@xxxxxxxxxxxxxxxxxx with:
unsubscribe ColorForth
as the first and only line within the message body
Problems   -   List-Admin@xxxxxxxxxxxxxxxxxx
Main ColorForth site   -   http://www.colorforth.com
Wiki page http://kristopherjohnson.net/wiki/ColorForth
ColorForth index http://www.users.qwest.net/~loveall/c4index.htm