Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Recording the Line Number in the Error Event
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00464195
Message ID:
00464220
Vues:
16
>I have a VB module that has the following function which is referenced in the ON ERROR GOTO statement:
>
>TRAP:
> Screen.MousePointer = vbNormal
> MsgBox "An error has occured in ProcessTables: " & Err.Description & " (" & CStr(Err.Number) & Err.Source & ")", vbCritical
> RaiseEvent Status("Errors occured during table processing.")
> ProcessTables = False
> Exit Function
>
>How do I add the line number of the code which triggered the error event to this statement?
>
>Thanks,
>
>Ben Holton

There is a way, but it's not pretty. VB inherited a function from the good 'ol days called "Erl" (Error Line). The ugly part is that you have to add line numbers to your code (eeeww..). It's undocumented in the newer versions of VB.

I've used it only once when I had a squirrely error I could not put my finger on. Once I fixed the problem I took out the line numbers and the call.

Also, I believe there is a third party vendor that sells a gadged that will do this for your projects. You may find some info on this at www.devx.com.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform