Raise Method

Syntax
object.Raise(number, source, description, helpfile, helpcontext)
The Raise method has these parts:

Part Description

object: Always the Err object.

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. When setting this property for an Automation object, use the form project.class. If nothing is specified, the programmatic ID of the current VBScript project is used.

description: A string expression describing the error. If unspecified, the value in number is examined. If it can be mapped to a VBScript run-time error code, a string provided by VBScript is used as description. If there is no VBScript error corresponding to number, a generic error message is used.

helpfile: The fully qualified path to the Help file in which help on this error can be found. If unspecified, VBScript uses the fully qualified drive, path, and file name of the VBScript Help file.

helpcontext: The context ID identifying a topic within helpfile that provides help for the error. If omitted, the VBScript Help file context ID for the error corresponding to the number property is used, if it exists.

Remarks

All the arguments are optional except number. If you use Raise, however, without specifying some arguments, and the property settings of the Err object contain values that have not been cleared, those values become the values for your error.

When setting the number property to your own error code in an Automation object, you add your error code number to the constant vbObjectError. For example, to generate the error number 1050, assign vbObjectError + 1050 to the number property.

时间: 2024-10-08 21:35:48

Raise Method的相关文章

Generating Sensible Error Messages Using Err.Raise

error Okay, I'll admit it, if there's one area where my ASP scripts are lacking: it's in the area of error checking. I've looked at the Err object included with VBScript but have been really frustrated with it's seemingly lack of information. (For mo

对LMAX架构以及Event Sourcing模式的一些新思考和问题的记录

最近又学习了一下LMAX架构,让我对该架构以及event sourcing模式又有了很多新的认识和疑问. 注:如果不知道什么是lmax架构和event sourcing模式的看官可以自己先去查查资料: LMAX可以看看martin写的一篇文章:http://martinfowler.com/articles/lmax.html Event Sourcing的资料比较多,随便google一下即可. 当然,我的博客里也有大量关于这两个方面的笔记,有兴趣的可以看看. 下面是我的一些最新的想法. LMA

用err.raise自定义错误信息

错误 我想大多数的人在编写ASP程序的时候,都碰到过类似的错误信息:   Error Number -> -2147467259   Error Source -> Microsoft OLE DB Provider for ODBC Drivers   Error Desc -> [Microsoft][ODBC Driver Manager] Data source name not found and no default driver 可时间上,这个错误信息对我们并不怎么有用,或

Numeric Parse Method

The Parse method converts a string that represents a .NET Framework numeric base type to an actual .NET Framework numeric base type. It takes the following forms, where XXX is the name of the numeric base data-type class: public static XXX Parse(Stri

改善代码设计 简化函数调用(Making Method Calls Simpler)

系列博客 1. 改善代码设计 -- 优化函数的构成(Composing Methods) 2. 改善代码设计 -- 优化物件之间的特性(Moving Features Between Objects) 3. 改善代码设计 -- 组织好你的数据(Composing Data) 4. 改善代码设计 -- 简化条件表达式(Simplifying Conditional Expressions) 5. 改善代码设计 -- 简化函数调用(Making Method Calls Simpler) 6. 改善

改善代码设计 —— 简化函数调用(Making Method Calls Simpler)

系列博客       1. 改善代码设计 -- 优化函数的构成(Composing Methods)       2. 改善代码设计 -- 优化物件之间的特性(Moving Features Between Objects)       3. 改善代码设计 -- 组织好你的数据(Composing Data)       4. 改善代码设计 -- 简化条件表达式(Simplifying Conditional Expressions)       5. 改善代码设计 -- 简化函数调用(Maki

改善代码设计 —— 简化函数调用(Making Method Calls Simple“.NET技术”r)

系列博客       1. 改善代码上海网站建设设计 -- 优化函数的构成(Composing Methods)       2. 改善代码设计 -- 优化物件之间的特性(Moving Features Between Objects)       3. 改善代码设计 -- 组织好你的数据(Composing Data)       4. 改善代码设计 -- 简化条件表达式(Simplifying Conditional Expressions)       5. 改善代码设计 -- 简化函数调

改善代码设计 —— 简化函数调用(Making Method “.NET研究”Calls Simpler)

系列博客       1. 改善代码设计 -- 优化函数的构成(Composing Methods)       2. 改善代码设计 -- 优化物件之间的特性(Moving Features Between Objects)       3. 改善代码设计 -- 组织好你的数据(Composing Data)       4. 改善代码设计 -- 简化条件表达式(Simplifying Conditional Expressions)       5. 改善代码设计 -- 简化函数调用(Maki

一起谈.NET技术,改善代码设计 —— 简化函数调用(Making Method Calls Simpler)

系列博客       1. 改善代码设计 -- 优化函数的构成(Composing Methods)       2. 改善代码设计 -- 优化物件之间的特性(Moving Features Between Objects)       3. 改善代码设计 -- 组织好你的数据(Composing Data)       4. 改善代码设计 -- 简化条件表达式(Simplifying Conditional Expressions)       5. 改善代码设计 -- 简化函数调用(Maki