Do you use an application object? If you want to shut down an application in mid-form, it seems to me that you would need to do quite a bit more than CLEAR EVENTS. For example, since not all errors are necessarily fatal, you would need to probably cancel, as Jayesh says. But you would also need to release any object references that got created during the life of the form.
There has been many threads on error handling in several of the groups. You might want to search on
www.dejanews.com (and do a power search).
Also, you might look at using ASSERT. Barbara Paltiel told me about it...it had always escaped my attention < g >. But it's really useful.
>I'm trying to capture all the anticipated errors in my programs and, for the errors that slip through, I have an ON ERROR procedure called BadError:
>
>PROCEDURE BadError
>
>=MESSAGEBOX(error message and number code here)
>CLEAR EVENTS
>
>ENDPROC
>
>The only problem is that CLEAR EVENTS doesn't clear events - the program continues to run as though nothing happened after the message box is displayed.
>
>Any ideas how to force my program to quit back to Windows?
>
>David Turnedge
>Sydney, Australia