Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Raising Errors - Should I
Message
De
30/08/2000 12:54:59
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00410823
Message ID:
00410864
Vues:
14
Hi Marty,

IMHO you don't want to error trap and shutdown an app because of input error. This penalizes the user for something that could be dealt with more positively, such as a messagebox or other means.

>Here's the deal. I'm writing a module that fits into a much larger application. The application has an excellent ON ERROR routine which logs everything and takes a snapshot of the system.
>
>At one point in my module, I check a value field which should never be higher than, say, 2400. If it is, my module will not be able to do its business. If the value is higher than 2400, something is very wrong with the system.
>
>I'm thinking of just putting the command:
>
>ERROR "The value " + STR(x) + " is higher than 2400."
>
>
>The system error handler will grab this, take a snapshot and walk the user through a shutdown of the app. Obviously, I'll make my module return a .F., and set an internal error flag as well.
>
>My question is this. What do you think of sounding my own ERROR within this module? Bad juju? I guess a more typical alternative would be to fire a message box explaining what happened and return a .F. from the module. But, if the problem identifies something that has gone haywire elsewhere in the system, shouldn't I sound the alarm?
>
>Marty
------------------------------------------------
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform