First page Back Continue Last page Summary Graphic
while, for
while {condição} { ... }
Exemplo:
while { $x < 5 } {
puts "x = $x"
incr x
}
O mesmo pode ser feito com um for:
for {set x 0} {$x < 5} {incr x} {
puts "x = $x"
}
Em geral: for {início} {teste} {após ciclo} { ...instruções... }