Information générale
Catégorie:
Codage, syntaxe et commandes
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
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement