Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error Event Not Firing
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Error Event Not Firing
Divers
Thread ID:
00841120
Message ID:
00841120
Vues:
53
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform