Built-in "Err" Object Properties and Methods

This section describes the built-in 'Err' object, and its properties and methods, Err.Number, Err.Description, Err.Source, Err.Raise(), Err.Clear().

We have used some properties and method of the "Err" object several times in our examples, now let's provide a summary about this built-in object:

1. "Err" is a built-in object representing the last runtime error that occurred during the execution.

2. "Err" has the following important properties.

3. "Err" has the following important methods.

Here is a list of commonly-occurred runtime errors pre-defined in VBScript:

Err.Number Err.Description  

5          Invalid procedure call or argument
6          Overflow
7          Out of Memory
9          Subscript out of range
10         This array is fixed or temporarily locked
11         Division by zero
13         Type mismatch
14         Out of string space
17         Can't perform requested operation
28         Out of stack space
35         Sub or function not defined
48         Error in loading DLL
51         Internal error
91         Object variable not set
92         For loop not initialized
94         Invalid use of Null
424        Object required

Table of Contents

 About This Book

 Introduction of VBScript - Visual Basic Scripting Edition

 Variant Data Type, Subtypes, and Literals

 Arithmetic Operations

 Numeric Comparison Operations and Logical Operations

 String Operations - Concatenation and Comparison

 Variable Declaration and Assignment Statement

 Expression and Order of Operation Precedence

 Statement Syntax and Statement Types

 Array Data Type and Related Statements

 Array References and Array Assignment Statements

 Conditional Statements - "If ... Then" and "Select Case"

 Loop Statements - "For", "While", and "Do"

 "Function" and "Sub" Procedures

 Built-in Functions

 Inspecting Variables Received in Procedures

Error Handling Flag and the "Err" Object

 Error Handling Rules Overview

 IE Option Setting - Enable Script Debugging

 "On Error Resume Next" - Turning on Error Handling

 "On Error GoTo 0" - Turning off Error Handling

 "Err.Number" and "Err.Clear()" - Error Code and Clear Method

Built-in "Err" Object Properties and Methods

 "Err.Raise()" - Raising Your Own Errors

 Regular Expression Pattern Match and Replacement

 scrrun.dll - Scripting Runtime DLL Library

 Creating Your Own Classes

 IE Web Browser Supporting VBScript

 IIS ASP Server Supporting VBScript

 WSH (Windows Script Host)


 PDF Printing Version