Syntax: Err.Raise(number, source, helpfile, description,
helpcontext)
The On Error Resume
Next statement, also called error handler, is a procedure-level statement. It
remains in effect within the procedure only which contains the on error
declaration. The VBScript interpreter, like several languages, raises an error
to higher calling levels till it determines a procedure which handles the
error. If nothing is found, the script halts and the user is presented along with
the error results through the interpreter.
The Raise method is utilized for generating run-time errors. All of the arguments
of this method are optional except Number.
Though, if you employ
Raise, without indicating some arguments & the property settings of the Err
object have values that have not been cleared, those values become values for
your error. While setting the number property to your own error code in
Automation object, you insert your error code number to the constant
vbObjectError. For instance, to generate the error number 1050, assign
vbObjectError + 1050 to the number property.
Arguments
|
Description
|
Number
|
A Long integer subtype that identifies the nature of the error.
VBScript errors (both VBScript-defined and user-defined errors) are in the range 0-
65535.
|
Source
|
A string expression naming the object or application that originally generated the error. while setting this property for an Automation object,
use the form project.class. If none is defined, the programmatic ID of the current VBScript project is used.
|
Description
|
A string expression defining the error. If unspecified, the value in number
is verified. If this can be mapped to a VBScript run-time error code, a string
provided through VBScript is utilized as the description. If there is no VBScript error equivalent
to number, a generic error message is utilized.
|
Helpfile
|
The wholly
qualified path to the Help file wherein help on this error can be found. If unspecified, VBScript uses the wholly qualified drive, path, & file name of the VBScript Help file.
|
Helpcontext
|
The context ID recognizing a topic in helpfile that provides help for the error. If omitted, the VBScript Help file context ID for the error corresponding to the number property
is utilized, if it exists
|
Comments
Post a Comment