?? vbs355.htm
字號(hào):
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML>
<HEAD><TITLE>Raise Method</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1">
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META NAME="PRODUCT" CONTENT="Visual Basic Scripting Edition">
<META NAME="TECHNOLOGY" CONTENT="SCRIPTING">
<META NAME="CATEGORY" CONTENT="Language Reference">
<META NAME="Keywords" CONTENT="Raise method"><META NAME="Description" CONTENT="Raise Method"></HEAD><BODY BGCOLOR=FFFFFF LINK=#0033CC>
<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END-->
<FONT FACE="Verdana, Arial, Helvetica" SIZE=2>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR VALIGN=TOP><TD WIDTH=360>
<FONT SIZE=1 COLOR=#660033>Microsoft® Visual Basic® Scripting Edition</FONT><BR>
<FONT SIZE=5 COLOR=#660033><B>Raise Method</B></FONT>
</TD>
<TD ALIGN=RIGHT>
<FONT SIZE=2> <A HREF="vbstoc.htm">Language Reference</A> <BR>
<A HREF="vbs16.htm">Version 1</A> <P></FONT>
</TD></TR>
</TABLE>
<FONT SIZE=2><P><A HREF="vbs357.htm">See Also</A> <A HREF="vbs356.htm">Applies to</A></FONT>
<hr noshade size=1>
<H5>Description</H5>
<BLOCKQUOTE>Generates a <A HREF="vbs0.htm#defRTErr">run-time error</A>.</BLOCKQUOTE>
<H5>Syntax</H5>
<BLOCKQUOTE><i>object</i><b>.Raise(</b><i>number</i><b>, </b><i>source</i><b>, </b><i>description</i><b>, </b><i>helpfile</i><b>, </b><i>helpcontext</i><b>)</b><P>
The <b>Raise</b> method has these parts:<P>
<TABLE WIDTH=87% BORDER=1 CELLPADDING=5 CELLSPACING=0>
<TR VALIGN=TOP BGCOLOR="#DDDDDD">
<TD><FONT SIZE=2><b>Part</b></FONT></TD>
<TD><FONT SIZE=2><b>Description</b></FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>object</i></FONT></TD>
<TD><FONT SIZE=2>Always the <b>Err </b>object.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>number</i></FONT></TD>
<TD><FONT SIZE=2>A <b>Long </b>integer subtype that identifies the nature of the error. VBScript errors (both VBScript-defined and user-defined errors) are in the range 0–65535.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>source</i></FONT></TD>
<TD><FONT SIZE=2>A <A HREF="vbs0.htm#defStringExpression">string expression</A> naming the object or application that originally generated the error. When setting this property for an Automation object, use the form <i>project</i><b>.</b><i>class</i>. If nothing is specified, the programmatic ID of the current VBScript project is used.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>description</i></FONT></TD>
<TD><FONT SIZE=2>A string expression describing the error. If unspecified, the value in <i>number</i> is examined. If it can be mapped to a VBScript run-time error code, a string provided by VBScript is used as <i>description.</i> If there is no VBScript error corresponding to <i>number</i>, a generic error message is used.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>helpfile</i></FONT></TD>
<TD><FONT SIZE=2>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.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>helpcontext</i></FONT></TD>
<TD><FONT SIZE=2>The context ID identifying a topic within <i>helpfile</i> that provides help for the error. If omitted, the VBScript Help file context ID for the error corresponding to the <i>number</i> property is used, if it exists.</FONT></TD></TR>
</TABLE></BLOCKQUOTE>
<H5>Remarks</H5>
<BLOCKQUOTE>All the arguments are optional except <i>number</i>. If you use <b>Raise</b>, however, without specifying some arguments, and the property settings of the <b>Err</b> object contain values that have not been cleared, those values become the values for your error. <P>
When setting the <i>number</i> property to your own error code in an <A HREF="vbs0.htm#defOLEAutomationObject">Automation object</A>, you add your error code number to the constant <b>vbObjectError</b>. For example, to generate the error number 1050, assign <b>vbObjectError</b> + 1050 to the <i>number</i> property.</BLOCKQUOTE>
<hr noshade size=1>
<p align=center><em><a href="../../common/colegal.htm">© 1997 by Microsoft Corporation. All rights reserved.</a></em></p>
</FONT></BODY></HTML>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -