I don't know if this is what you are looking for exactly...
scan
*--- do some code
**-- check for an escape key pressed by the user
if inkey()=27
return(.f.)
endif
endscan
You can display a message to 'Press Escape to cancel...'
Hope this helps
>How do I set up a cancel button to cleanly cancel a process?
>If I have a process button running code in a form, how do I put
>in a cancel button that stays active during the processing so
>that when the cancel button is clicked the processing is stop
>and some cleanup code is run?
>
>Thanks in advance, Robert.
Thanks,
Stacy
Black Mountain Software, Inc.