Clears all property settings of the Err object.
object.Clear |
Remarks
The object is always the Err object.
Use Clear to explicitly clear the Err object after an error has been handled. This is necessary, for example, when you use deferred error handling with On Error Resume Next. VBScript calls the Clear method automatically whenever any of the following statements is executed:
-
On Error Resume Next
-
Exit Sub
-
Exit Function
The following example illustrates use of the Clear method.
Copy Code | |
---|---|
On Error Resume Next Err.Raise 6 ' Raise an overflow error. MsgBox ("Error # " & CStr(Err.Number) & " " & Err.Description) Err.Clear ' Clear the error. |
Requirements
Applies To: Err Object (VBScript)