DO WHILE .T. @ 05,07 GET maccd @ 06,07 GET machddtls VALID vcheck() READ IF LASTKEY()=27 EXIT ENDIF ENDDO FUNC vcheck command lines ... * If ESCape is pressed here I need to reset the lastkey() value ELSE i am thrown out of the DO WHILE RETURN