Clear Method (VBScript)

 

Clears all property settings of the Err object.

Syntax

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 can be useful, for example, when you use deferred error handling with On Error Resume Next.

Visual Basic Scripting Edition (VBScript) calls the Clear method automatically whenever the On Error Resume Next statement is executed.

The following example illustrates use of the Clear method.

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

Requirements

Version 1

Applies To: Err Object (VBScript)

Change History

Date

History

Reason

September 2009

Modified Remarks.

Customer feedback.

See Also

Description Property (VBScript)
Err Object (VBScript)
Number Property (VBScript)
On Error Statement
Raise Method
Source Property (VBScript)