Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
On error not firing
Message
 
 
À
05/09/2001 11:46:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00552535
Message ID:
00552597
Vues:
20
Daniel,

I usually try to prevent error in my programs themselves. In other words, my colleague is working on Global Error Handler, but in my programs I sometimes use the technique showed. It works fine standalone, but if this program is invoked by form, the form (or object) error method takes precedance.

>Nadya,
>
>As you mentioned, if an error occurs in an object, then the object's error method fires. If you want to invoke your global error handler, you have to do something like this in the error method:
>
>
>lcOnError = ON("ERROR")
>	
>*-- check if there's an error handler in effect
>IF NOT EMPTY(lcOnError)		
>	*-- call error handler
>	&lcOnError
>	RETURN
>ELSE
>	*-- handle error here
>ENDIF
>
>
>>>For some reason our on error event is not firing. I even tried setting step on and typing "on error" in the command window prior to the line of code that should have issued the error? When this didn't work I typed "on error" on the line preceeding the line of code that should have issued the error.
>>>
>>>Many thanks.
>>
>>I noticed the similar behavior. For instance, the form, which has code in Error event, calls a program, which has these lines
>>
>>local lcOldError
>>lcOldError=on('error')
>>on error do myErrorHandling
>>my code
>>on error &lcOldError
>>return
>>
>>
>>I noticed, that my own error messages were never shown, so the form Error event takes precedance.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform