>>
>>I definitely have MyProc exiting, I can get it
after the SCAN loop. And I tried already the code, almost as you have it. Except I was checking for lStop within SCAN/ENDSCAN. I will try it now with lStop being at the SCAN line. But somehow I think my ON ESCAPE does not fire. And I do have SET ESCAPE ON. And I checked that within MyProc nothing changes the SET ESCAPE.
>>
>>Thank you for your help.
>
>Is the code running in a form or other control that has a .KeyPress method? Is there a form with .KeyPreview set .T.? That might be eating keystrokes.
Could it be that my test =messagebox() gets cleared because I press Esc while the SCAN goes on? That is, I need to clear keyboard buffer right before =messagebox(), right? If so, how do you do it?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham