Version 4 of break

Updated 2002-05-06 15:13:09

Documentation can be found at http://purl.org/tcl/home/man/tcl8.4/TclCmd/break.htm


One surprising use of break is to make sure a foreach loop runs exactly once (because we're only interested in the list assignment, not the actual body):

 foreach {a b} [list $b $a] break

Tcl syntax help Arts and crafts of Tcl-tk programming Category Command