Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get error handler?
Message
De
02/09/1998 00:57:09
 
 
À
01/09/1998 19:38:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00132084
Message ID:
00132206
Vues:
16
Hi Erik ---

You are correct in the general sense...my code reflected the given that there was a handler in place.....although if not (or may not be) the EMPTY control block should be removed.


>>Is the original error handler set using ON ERROR? If so, you can use Josh's suggestion in the following manner:
>>
>>PROCEDURE MyFunction
>>LOCAL cErrorHandler
>>cErrorHandler=ON("ERROR")
>>ON ERROR DO newhandler   && Change
>>.
>>.
>>IF !EMPTY(cErrorHandler)
>>   ON ERROR &cErrorHandler
>>ENDIF
>>RETURN  && Back to calling program
>>
>>
>
>Careful there. this routine will leave the temporary error handler in place if there was no previous handler.
>
>You don't need to check for EMPTY, because issuing ON ERROR with no arguments clears the error handler, just like it was before, so will be safe issuing
>
>ON ERROR &cErrorHandler
>
>whether or not there is anything in the variable.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform