• Support
  • Articles
  • Resources
  • Products

exit from while loop with a key or mouse press

Moderator: boris

3 postsPage 1 of 1

rdm
Newbie

Posts:
11
Joined: Fri Jul 29, 2011 4:44 pm
by rdm » Wed Jul 19, 2017 11:00 pm
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?
Trevor
Guru

Posts:
485
Joined: Wed Jul 26, 2006 8:47 am
by Trevor » Thu Jul 20, 2017 12:39 pm
can you provide the while loop code please?
rdm
Newbie

Posts:
11
Joined: Fri Jul 29, 2011 4:44 pm
by rdm » Thu Jul 20, 2017 4:25 pm
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
Display posts from previous:
Sort by:

3 postsPage 1 of 1

Users browsing this forum: No registered users