Created
January 23, 2012 21:43
-
-
Save ldaniel/1665674 to your computer and use it in GitHub Desktop.
Tratando erros no Visual Basic 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub InitializeMatrix(Var1, Var2, Var3, Var4) | |
On Error GoTo ErrorHandler | |
' algum codigo aqui | |
Exit Sub | |
ErrorHandler: | |
' rotinas executadas caso ocorra alguma excecao, eh possivel | |
' recuperar informacoes da excecao atraves das propriedades | |
' presentes na classe Err, tais como: | |
' Err.Number e Err.Description | |
Resume Next | |
End Sub | |
' Eh possivel forcar o lancamento de um erro de execucao em | |
' runtime da seguinte forma: | |
' On Error GoTo 0 | |
' Err.Raise E_NOTIMPL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment