>I've got a really strange problem. I've got a form that runs a long process within a loop. I want the user to be able to hit Escape to exit the loop. I've implemented this in the standard way:
>
>llXit = .F.
>on escape llXit = .T.
>set escape on
>scan while not llXit
> ... Processing code here
> DOEVENTS
>endif
>
>This works as expected if I just DO FORM.... from the Command Window. However, if I call it from the menu of my app, it either ignores the Escape key or hangs. The menu option is just a command that says DO FORM... just like I do from the command window. The form has a private datasession.
>
>I'm sure there's some difference in the environment between the two situations that's causing this difference in behavior, but I can't figure out what it is. Anyone have suggestions as to what I can check?
Barbara,
All I've got is a WAG. IOW, it ain't even scientific. I've noticed, however, that VFP's processing of the ESC key leaves a lot to be desired.
As you know, the default setting of SET ESCAPE is ON. I can't tell you, however, how many times (with that setting) I've tried to interrupt an executing routine and have had to sit there, mashing the ESC key as fast as I can, in order to get the routine to break.
The upshot is that I think this is a VFP problem rather than something with your code. I know it doesn't help much, but perhaps you could think up an alternate solution.
Best,
George
Ubi caritas et amor, deus ibi est