Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error Event Not Firing
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Error Event Not Firing
Miscellaneous
Thread ID:
00841120
Message ID:
00841120
Views:
52
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???
PROCEDURE Error
LPARAMETERS nError, cMethod, nLine 

  LOCAL aErrorInfo[1], nRows

  WITH This

    =AERROR(aErrorInfo)
    nRows = ALEN(aErrorInfo, 2)
    DIMENSION .aErrorInfo[nRows + 3]

    ACOPY(aErrorInfo, .aErrorInfo)
    .aErrorInfo[lnRows + 1] = cMethod
    .aErrorInfo[lnRows + 2] = nLine
    .aErrorInfo[lnRows + 3] = DATETIME()

    .lErrorOccurred = .T.
    .cErrorMessage  = .aErrorInfo[IIF(tnError = 1429, 3, 2)]
			
  ENDWITH

  RETURN
		
ENDPROC
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Next
Reply
Map
View

Click here to load this message in the networking platform