Sunday, December 8, 2013

On Error Statement | Classic ASP | ASP | VB Script

On Error Statement in VB Script

Hello friends, let us start to learn about "On Error Resume Next", as we know run-time errors, stopped code and display error message. Some times we need to handle such type of Errors, in some cases.

"On Error Resume Next" Statement provides the execution to continue with the statement immediately following the statement that caused the run-time error. In other words we can say "On Error Resume Next" statement is error-handling routine inline within the procedure.

On Error Resume Next
Err.Raise 6 ' Raise an overflow error.
MsgBox "Error # " & CStr(Err.Number) & " " & Err.Description
Err.Clear ' Clear the error.