Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error Event Not Firing
Message
From
22/10/2003 13:03:58
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00841120
Message ID:
00841142
Views:
27
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform