Name

break — Break out of a loop.

Synopsis

break

Description

The break command breaks out of a loop. If this command is not run from within a loop - the while or foreach commands for instance, it generates an error.

Example

set i 0
while { true } {
    if { > $i 100 } {
        break
    }
    incr $i
}
	  

In what would otherwise be an endless loop, the break command is used to exit.