Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Big Error Handling Problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00629152
Message ID:
00629181
Vues:
12
>This is a disturbing issue we just found coincidentally. We have a base form class that we subclassed from VFP's form class. In that class, we have overridden the Error method in this class to specifically trap invalid date values that would trap the user in a deadly loop. Here's the code for that Error method:
>
>
>LPARAMETERS nError, cMethod, nLine
>
>IF (nError != 2034)
>
>   RETURN (DODEFAULT(nError, cMethod, nLine))
>
>ELSE
>
>   THIS.DisplayErrorMessage("You have entered an invalid date!", "Input Error")
>   THIS.GotFocus()
>   THIS.ActiveControl.SetFocus()
>
>ENDIF
>
>
>The disturbing thing about this is that any other error code aside from 2034 is not producing any error message, even though there's a DODEFAULT right there in the code. We've stepped through the debugger on a predictable error (e.g. "Cannot update the cursor") and it's as if the DODEFAULT does nothing with the error. We also confirmed that ON("ERROR") is empty.
>
>Does anyone have any ideas as to how to resolve this?
>
>Laterness,
>Jon

In addition to Roi's explanation see Forum: Visual FoxPro Category: Visual FoxPro in general Title: Re: How to trap errors with ON ERROR while error event in place Thread #618670 Message #618918 (or the whole thread).
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform