Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

breaking an endles loop

Status
Not open for further replies.

toaran

Technical User
Nov 19, 2002
8
0
0
DE
hi

i have the problem.. i have an endless loop and want press a key to stop the loop .....

is this posible ???

i use the NT ported version
 
With wish:

set ::stop 0
pack [button .s -text Break! -command { set ::stop 1 }]
while 1 {
# this is an endless loop
if {$::stop} { break }
update
}
.s config -text stopped

The 'update' permits the button to gain control and stop the endless loop thru a global control variable.
For that, you need to use wish.

HTH

ulis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top