Version 4 of continue

Updated 2005-04-20 04:28:50

http://purl.org/tcl/home/man/tcl8.4/TclCmd/continue.htm


Suppose the following code:

 foreach  i  $List1  { 

     foreach  j  $List2  { 

        if  [some condition] {continue}

        eval {blah blah blah}
     }
 }

Continue interrupts the foreach j loop. But what if I wanted it to break the foreach i loop?

Place the [foreach i] command in a proc and use return instead of continue.


[ Tcl syntax help | Arts and crafts of Tcl-Tk programming | Category Command | Category Control Structure ]