continue(3tcl)
π continue β bestie edition π
okay so this is continue(3tcl), straight out of the Tcl Built-In Commands lineup, and it's literally the "skip to the next one" button for your loops. tiny command, huge main character energy. β¨
πΈ NAME πΈ
continue β skip to the next iteration of a loop π
π SYNOPSIS π
continue
that's it. that's the whole thing. no args, no flags, no drama. she's a one-word queen. π
β¨ DESCRIPTION β¨
so bestie, you usually call this one inside the body of a looping command β think for or foreach or while. π
when you invoke it, continue returns a 4 (TCL_CONTINUE) result code, and that is what makes a continue exception happen. and what does that exception do? it aborts the current script and bounces it out to the innermost containing loop command, which then just... continues on with the next iteration of the loop. like nothing happened. iconic behaviour honestly. π¦
and it's not only loops that deal with continue exceptions β they're also handled in a few other situations, like the catch command and the outermost scripts of procedure bodies. so iykyk, it shows up in more places than you'd expect. π
π EXAMPLE π
ok so imagine you wanna print a line for each of the integers from 0 to 10 except 5. rude to skip 5 but okay, we ball:
for {set x 0} {$x<10} {incr x} {
if {$x == 5} {
continue
}
puts "x is $x"
}
see how continue just nopes out of that one iteration and the loop keeps rolling? chef's kiss. ππ
π«Ά SEE ALSO π«Ά
π KEYWORDS π
continue, iteration, loop
and that's the whole page, bestie β brought to you by Tcl and the manual page continue(3tcl). go skip some iterations, you got this. ππ§πΈ
π¦ where this page comes from
- debian trixie: tcl9.0-doc 9.0.1+dfsg-2
- ubuntu questing: tcl9.0-doc 9.0.2+dfsg-1
- ubuntu resolute: tcl9.0-doc 9.0.3+dfsg-1
- ubuntu stonking: tcl9.0-doc 9.0.4+dfsg-1
- Copyright (c) 1993-1994 The Regents of the University of California
- Copyright (c) 1994-1996 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms