Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error Event Not Firing
Message
De
22/10/2003 13:03:58
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00841120
Message ID:
00841142
Vues:
28
Kevin-

>I have coded the error event below into a PRG based class. I am testing
>it from an OpenTable method, passing a table name that doesn't exist, and
>I get a standard VFP error:
>
>"File 'c:\dummy.dbf' does not exist"
>
>Why isn't this error procedure catching the error???

I think we need to step back. I can't recreate the problem with a simple example in 8.0 or 7.0.
LOCAL lo
lo = NEWOBJECT('myClass')
DEFINE CLASS myClass AS FORM

  PROCEDURE ERROR(tnError, tcMethod, tnLine)
    MESSAGEBOX("Error " + LTRIM(STR(tnError))+" in "+tcMethod+CHR(13)+MESSAGE())

  PROCEDURE LOAD
    USE SomeDBF AGAIN IN 0 SHARED
So, how do you know your error method isn't running? IOW, have you put a breakpoint on the line that tries to use the table (?) and then followed the program? Do you have an ON ERROR statement? That *shouldn't* matter since error events take precedence over object error events, but you might want to simplify things as much as possible at least til you find the problem.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform