Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to trap errors with ON ERROR while error event in pl
Message
 
 
À
11/02/2002 22:12:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00618670
Message ID:
00618672
Vues:
14
Hi Mark,

As you already figured out, there is no way and that's unfortunate. I was caught by this behavior couple of times... I'm not sure, we can wish about it for Toledo, because adding ability to switch will break the existing code...

>Does anyone know of a way to set an ON ERROR statement in a prg and not have an actual Error passed back up to an Error() Event in an object that called the prg?
>
>For instance, in the CodeMine framework, Error trapping code is in the application object Error() event as well as in other classes. I want to call a utility prg which does its own error trapping. However, the ON ERROR's in the prg get ignored. I would really like a way to override the errors being passed up to the error event, and trap them right there.
>
>It seems that VFP needS an optional switch on the ON ERROR statement that will allow an ON ERROR statement to supercede an Error() event.
>
>
>For example, my prg might have code as follows:
>
>m.lcSavOnError= on("error")
>m.llFlag= .f.
>ON ERROR m.llFlag= .t.
>
>Use mytable
>
>ON ERROR &lcSavOnError
>
>if m.llFlag
> *..display error we got when using table
>endif
>
>Thanks in advance.
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