/ Published in: Visual Basic
Per creare una nuova funzione completa di un gestore errori.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
'+///////////////////////////////////////////////////////////////////+ '+===================================================================+ Public Sub GestoreErrori(err_Errori As Errors) '+===================================================================+ ' DESCRIZIONE: ' ARGOMENTI: ' RITORNA: '+===================================================================+ ' ___________________________________________________________________ '|> VARIABILI LOCALI Dim str_Errore As String Dim err_ErrCiclo As Error ' ___________________________________________________________________ '|> Elenca l'insieme Errors e visualizza le proprietà '|> di ogni oggetto Error For Each err_ErrCiclo In err_Errori With err_ErrCiclo str_Errore = _ "Errore #" & .Number & vbCr & vbCr & _ " " & .Description & vbCr & _ " (Origine: " & .Source & ")" & vbCr & vbCr & _ "Premere F1 per consultare l'argomento " & .HelpContext & vbCr & _ " nel file " & .HelpFile & "." End With MsgBox str_Errore, vbApplicationModal + vbCritical + vbOKOnly, cnt_TitoloMsg & ": errore" Next Err.Clear End Sub '+===================================================================+ '+\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\+ '+///////////////////////////////////////////////////////////////////+ '+===================================================================+ Function NuovaFunzione() '+===================================================================+ ' DESCRIZIONE: ' ARGOMENTI: ' RITORNA: '+===================================================================+ ' ___________________________________________________________________ '|> ABILITO GESTIONE UTENTE DEGLI ERRORI On Error GoTo Errors_Handler ' ___________________________________________________________________ '|> VARIABILI LOCALI ' ___________________________________________________________________ '|> Istruzioni ' ___________________________________________________________________ '|> ESCO DALLA ROUTINE Exit_Routine: Exit Function ' ___________________________________________________________________ '|> GESTISCO GLI ERRORI Errors_Handler: Call GestoreErrori(Errors) Resume Exit_Routine End Function '+===================================================================+ '+\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\+