ÄúµÄλÖãºÑ°ÃÎÍøÊ×Ò³£¾±à³ÌÀÖÔ°£¾VBScript£¾VBScript


objects constants operators statements functions properties methods







METHOD:  Err.Raise

object.Raise(number[, source, description, helpfile, helpcontext])

This method is used to generate a VBScript run-time error. The arguments, with the exception of number, are all optional. Note that if no arguments are supplied, any error values that have not been cleared from the Err object will automatically be inherited by the new instance of the object.

Code:
On Error Resume Next
Err.Raise 8    'raise a user-defined error
Err.Description = "My Error"
Err.Source = "MyAppName"
Response.Write "An Error of the type '" & Err.Description & "' has been_
                         caused by '" & Err.Source & "'."

Output:
"An Error of the type 'My Error' has caused by 'MyAppName'."