DIAdem Help

Content Type
Programming Language
Current manual
Table of Contents

Method: Raise for Err

Method: Raise for Err

Generates a runtime error.

Object.Raise(number, Source, Description, helpfile, HelpContext)
ObjectErr
Object with this method
numberVariant
Specifies the error number. VBScript errors range from 0 to 65535.
SourceVariant
Specifies the name of the application that triggered an error. If you do not specify a value, the Raise method uses the "Microsoft VBScript runtime error" value.
DescriptionVariant
Returns an error description. If you do not specify the value and if number corresponds to a VBScript runtime error, the Raise method uses the error description of this runtime error. Otherwise, the method uses a general error description.
helpfileVariant
Specifies the path to a help file. The help file must be an HLP file.
HelpContextVariant
Specifies the ContextID of a help topic.

The following example generates an error and displays the error number and the error description:

Dim sOutput
On Error Resume Next
Call Err.Raise(6) 'Raise an overflow error
If Err.Number <> 0 Then
   sOutput = "Error Number: " & Err.number & VBCrLf & _
             "Description: " & Err.Description
   Call MsgBox(sOutput, , "Error: " & Err.Description)
End If
On Error Goto 0
Call Err.Clear()
In This Section
Was this information helpful?