LogMeTT.com • exit from while loop with a key or mouse press
Page 1 of 1

exit from while loop with a key or mouse press

Posted: Wed Jul 19, 2017 11:00 pm
by rdm
I have a while loop continuously receiving data from a com port. Is there a message or box that can be displayed to display an option to exit or stop the script? I will also need to close a log file before exiting. TT has a pause/end box that is minimized while running - can this box be made visible while running and will it close the log file?

Re: exit from while loop with a key or mouse press

Posted: Thu Jul 20, 2017 12:39 pm
by Trevor
can you provide the while loop code please?

Re: exit from while loop with a key or mouse press

Posted: Thu Jul 20, 2017 4:25 pm
by rdm
counter2 = 0

while 1=1
int2str strcount counter
sprintf2 s "WaitForError- %d" counter
timeout=30 ;set rx timeout to 30 seconds

;;;wait for disconnect msg, increment a counter and display it
waitregex 'state changed to DIS-CONNECTED'
if result = 1 then
counter2 = counter2+1
int2str strcount2 counter2
statusbox strcount2 'failures'
endif

endwhile