Name

while — While loop.

Synopsis

while condition body

Description

The while command continues to evaluate body while condition is true.

Example

set i 0
while { < $i 6 } {
    puts "i is $i"
    incr $i
}
	  

Produces:

i is 0
i is 1
i is 2
i is 3
i is 4
i is 5