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:
00629166
Vues:
15
VFPs base form class error does not do anything, so calling dodefault() does what you see, nothing.

You would need to add your own code in the .T. portion of the if to handle the error.

For a good OOP error handler see www.stonefield.com, Doug has a paper in the technical articles area of his site.

>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
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform