continue(n)
β¨ continue(n) β¨
the Tcl Built-In Commands girlies are back at it again and this one is literally the skip button for your loops π
NAME πΈ
continue β skip to the next iteration of a loop, no notes π
SYNOPSIS π¦
continue
DESCRIPTION π
okay so bestie, picture this: you're deep inside the body of a looping command β like for or foreach or while β and you just need to bail on this one round and let the loop move on. that's literally what this is. π«Ά
when you call it, continue returns a 4 (that's TCL_CONTINUE for the girlies keeping score at home), and that return value makes a continue exception happen. not me causing exceptions on purpose π iconic behavior honestly.
so what does that exception do? it aborts the current script and unwinds it all the way out to the innermost containing loop command, and then that loop justβ¦ keeps going. next iteration. slay. π₯
and lowkey it's not only loops that handle these β continue exceptions also get handled in a few other situations too, like the catch command and the outermost scripts of procedure bodies. iykyk π
EXAMPLE π
say you wanna print a line for each of the integers from 0 to 10 β but not 5, because 5 did something to you personally and you're holding a grudge:
for {set x 0} {$x<10} {incr x} {
if {$x == 5} {
continue
}
puts "x is $x"
}
see how the 5 gets skipped like it's on read? that's the whole vibe check right there. πβ¨
SEE ALSO π
KEYWORDS π
continue, iteration, loop β the holy trinity fr fr π
heads up bestie: this one is a control-flow girly, so it only makes sense inside a loop. calling it out in the wild is giving chaos energy π
and that's the tea, babe π this page came to you straight from Tcl (source: Tcl), and yes it's the continue(n) page β no date on this one, she's timeless, main character energy only ππΈ
π¦ where this page comes from
- alpine 3.23: tcl9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tcl9-doc 9.0.3-r2 Β· TCL
- fedora 43: tcl-doc 1:9.0.2-1.fc43 Β· TCL AND GPL-3.0-or-later WITH Bison-exception-2.2 AND BSD-3-Clause
- fedora 44: tcl-doc 1:9.0.2-1.fc44 Β· TCL AND GPL-3.0-or-later WITH Bison-exception-2.2 AND BSD-3-Clause
- nixos 26.05: tcl 9.0.3
- nixpkgs unstable: tcl 9.1.0
- 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