Name

while

.sp −1p while test body

A loop construct that repeatedly evaluates expression test; if it returns a true value, it executes body.

Example

set i 1
while {$i <= 10} {
     puts $i
     incr i
}

Get Tcl/Tk in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.