Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ON ERROR mystery
Message
De
11/08/2005 07:19:19
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01040132
Message ID:
01040141
Vues:
13
>- My prg1.prg uses bunch of "ON ERROR do errhand" commands to perform specific functions (add accounts, items, etc. when they don't exist).
>
>- When I "DO prg1" from the COMMAND WINDOW, the ON ERROR triggers and all is fine.
>
>- When I "DO form1" and a button click on this form, does "DO prg1", the ON ERROR events trigger and all is fine.
>
>- But when I "DO prg1" from another form (form2), the ON ERROR commands do NOT tigger, instead form2.error() triggers (which does not do all that needs to be done).
>
>- Even when I "DO form1" (which has "DO prg1" in it) from from2, the ON ERROR still do not work.
>
>Both form1 and form2 are from the same class library. I have put the same exact code in the .error() event of both forms. I can't understand why one form allows the ON ERROR on the prg1 to be triggered, and the other does not ?
>
>I am confused!.
>Would appreciate your help.

The helpfile says:
Occurs when there is a run-time error in a method.

The Error event allows an object to handle errors. This event overrides the current ON ERROR routine and allows each object to trap and handle errors internally.

Note The Error event is called only when the error occurs in code.


So, if the error() method is filled with code, it overrides your ON ERROR setting. And it only is called if the error occurs in a method. Perhaps the type of error varies for form1 and form2?
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform