Flow-control structures: Difference between revisions

Line 506:
 
=={{header|Tcl}}==
=== loop control ===
Tcl has the <code>break</code> command to abort the current loop (for/foreach/while) and the <code>continue</code> command to skip to the next loop iteration.
 
=== exception ===
Tcl's <code>catch</code> command can be used to provide a basic exception-handling mechanism:
<lang tcl> if {[catch { ''... code that might give error ...'' } result]} {
puts "Error was $result"
Anonymous user