* Valid IF LastKey() = 27 RETURN && valid is passed ENDIF * Other valid code hereIf it is allowing a process to be interrupted by the cancel button then you need to process events at regular intervals during the process.
* Some lengthy process LOCAL lnCntr lnCntr = 1 DO WHILE ... Blah Blah Blah lnCntr = lnCntr + 1 IF MOD(lnCntr,100) = 0 DoEvents IF LastKey() = 27 Exit ENDIF ENDIF ENDDO