You can't interrupt any ongoing process, such as a
loop, except by placing the line DoEvents in an
iteration. DoEvents causes the program to temporarily stop,
see if there are any other commands that also need doing,
and work on those for a while.
Otherwise, your PC is so busy executing the loop that
it never has time to see your "Halt!" command.
DoEvents switches control to the operating-environment kernel. Control returns to your application as soon as all other applications in the environment have had a chance to respond to pending events. This doesn't cause the current application to temporarily stop or give up the focus, but it does enable background events to be processed.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.