Mohammed,
If you use ON ESCAPE {do something}, then the messagebox should not appear. One common ploy is to set a flag when the user presses ESCAPE and use that to exit the time-consuming loop. For example (not tested, just off the top of my head):
local lcOnEscape, llEscapePressed
lcOnEscape = ON("ESCAPE")
ON ESCAPE llEscapePressed = .t.
llEscapePressed = .f.
do while ! (llEscapePressed or eof())
enddo
ON ESCAPE &lcOnEscape.
if llEscapePressed
endif
You may have to play with the variable declaration. I'm not sure if the ESCAPE event handler can see variables that are declared LOCAL.
The following example is from the MSDN help file:
SET ESCAPE ON
ON ESCAPE DO stopit
WAIT WINDOW 'Press ESC to stop loop' NOWAIT
glMoreLoop = .T.
DO WHILE glMoreLoop
ENDDO
RETURN
PROCEDURE stopit
glMoreLoop = .F.
RETURN
Cheers,
Andrew
>Andrew it shaws the messagebox saying "PROGRAM ERROR " and it show "INTRUPTED" i dont want that message to come
>
>
>Mohammed
If we were to introduce Visual FoxBase+, would we be able to work from the dotNet Prompt?
From Top 22 Developer Responses to defects in Software
2. "It’s not a bug, it’s a feature."
1. "I thought I fixed that."
All my FoxTalk and other articles are available on my
web site.
Unless specifically identified otherwise, anthing posted here is purely my opinion and may or may not reflect the policies or practices of Microsoft.