Tcl usually executes a script file as one large block, returning only after execution of the entire file. For the run command, however, the command-line debugger executes script files line-by-line. If a particular line is not a complete Tcl command, the debugger appends the next line. The debugger continues appending lines until it gets a complete Tcl script block.
The listing below lists code that includes a script. For the Tclsource command, the debugger executes this script as one block. But for the run debug command, the debugger executes this script as two blocks, the set statement and the while loop.
set x 0; while {$x < 5} { puts "x is $x"; set x [expr $x + 1] }