Skip to content

Instantly share code, notes, and snippets.

@ldaniel
Created January 23, 2012 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ldaniel/1665674 to your computer and use it in GitHub Desktop.
Save ldaniel/1665674 to your computer and use it in GitHub Desktop.
Tratando erros no Visual Basic 6
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