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.
Err.Number - The code value of the runtime error. For example, Err.Number = 11 is the code
value of the "Division by zero" error. See the list of common error code values below.
Err.Description - The description string of the runtime error.
Err.Source - The source string of the runtime error.
3. "Err" has the following important methods.
Err.Raise(number, source, description) - Raises a new runtime error with your own error code,
source and description.
Err.Clear() - Clears the current runtime error.
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