llGetOut = .F. ON KEY LABEL ESCAPE DO GetOut DO WHILE NOT llGetOut * allow ESC or insert (for dev) to cancel seach ---code here **** more code here ENDDO ON KEY LABEL ESCAPE RETURN PROCEDURE GetOut llGetOut = .T. RETURN ENDPROCThe OKL is a intercommand interrupt so it will be evaluated after each command is executed. Pressing escape will end the loop after the current iteration completes.