I think that you need an EXIT command in the IF MDOWN() to exit out of the SCAN/ENDSCAN block.
>Hi,
> I would like to allow user to cancel a long process by clicking a "Cancel" button. I tried to use "Fast doevents" in my code as the following:
>
>
>SELECT mytable
>
>SCAN
> **DO WATEVER
> IF MDOWN()
> DOEVENTS()
> ENDIF
>ENDSCAN
>
>
>
>I found that, MDOWN() return .T. once I click on my "Cancel" button. However, my code in cancel button.CLICK() is not fired. Any ideas?
>
>Thank you