is_interrupted
is_interrupted
{-check | -start | -stop}
Description
Controls the interrupt checker. You use the interrupt checker in Tcl scripts to break out of sequences and loops.
Arguments
|
Checks for a user interrupt. If the |
|
Value Returned
|
For |
Examples
The following example illustrates how to start, check, and stop the interrupt checker in a script.
# start the interrupt checker
is_interrupt -start
while {<condition is true>} { # has the ESC key been pressed?
if {[is_interrupted -check]} {
# user interrupted loop. Stop the interrupt checker and break out.
is_interrupted -stop
return;
}
# No interrupt, continue with normal loop processing here
}
# stop the interrupt checker is_interrupted -stop
Related Topics
Return to top