Name
continue
— Skip to next cycle of a loop
Description
The continue command is used within the bodies of looping
commands such as if and
while. When continue
is called, execution of the loop body stops and and
execution moves on to the next iteration of the loop.
Example
set i 0
set res {}
foreach x {a b c d e} {
incr $i
continue
append $res $x
}
puts $i
puts $res
Produces:
5
The res variable is never appended to, so printing it out
produces an empty string.