Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conflict with internally generated error messages
Message
From
11/05/1998 17:38:47
 
 
To
11/05/1998 13:33:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00098530
Message ID:
00098597
Views:
26
Cetin pretty much gave you the answer, but I'm not sure if it was clear. Put the program errmsg by itself as a program called ERRMSG.PRG. Also, if you don't want it to execute in certain forms, you can save the current error handler before entering the form:

In the init code:
* Save the error message into a property you add to the form
Thisform.r_cSaveError = ON('error')
* Return to the default error handler
ON ERROR

In your close code:
* Return to the error handler used before you entered the form
ON ERROR &Thisform.r_cSaveError

If its not a modal form you really might want to put this code in the Activate and Deactivate methods. Otherwise I suppose you might have a weird problem where the error handler gets deactivated in an inappropriate form. In fact, that might be the reason for your bug. (Because the ON ERROR is global and does not scope to a datasession.)

Adam


>I inherited a Foxpro/Lan 2.0 application with no error trapping and I just recently added some error handling to some of the screens. Now sometimes users are getting an error message saying "file errmsg not found" The name of my error handling routine is errmsg. I have an ON ERROR command on a screen that has pushbuttons which open other screens that don't have the ON ERROR command. Is that what is causing the problem? Do I have to have error handling on all screens or none at all? Why do Foxpro's internally generated error messages not display when there is no error handling on a particular screen? Hope someone can help me. Thanks
Previous
Reply
Map
View

Click here to load this message in the networking platform