Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error handler (urgent)
Message
 
To
22/05/2001 04:04:28
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00509776
Message ID:
00509783
Views:
17
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())
  ** processing happens here
enddo

ON ESCAPE &lcOnEscape.

if llEscapePressed
  ** the user pressed ESCAPE - clean up and exit
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform