📄 vbs577.htm
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML><HEAD><TITLE>Exit Statement</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="Exit statement,Exit Do,exiting,Exit For,Exit Sub,terminating,Exit Function,Exit Property,ending execution"><META NAME="Description" CONTENT="Exit Statement"></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>Exit Statement</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="vbs578.htm">See Also</A></FONT>
<hr noshade size=1>
<H5>Description</H5>
<BLOCKQUOTE>Exits a block of <b>Do...Loop</b>, <b>For...Next</b>, <b>Function</b>, or <b>Sub</b> code. </BLOCKQUOTE>
<H5>Syntax</H5>
<BLOCKQUOTE><b>Exit Do<P>
Exit For<P>
Exit Function<P>
Exit Sub</b><P>
The <b>Exit</b> statement syntax has these forms:<P>
<TABLE WIDTH=87% BORDER=1 CELLPADDING=5 CELLSPACING=0>
<TR VALIGN=TOP BGCOLOR="#DDDDDD">
<TD><FONT SIZE=2><b>Statement</b></FONT></TD>
<TD><FONT SIZE=2><b>Description</b></FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><b>Exit Do</b></FONT></TD>
<TD><FONT SIZE=2>Provides a way to exit a <b>Do...Loop</b> statement. It can be used only inside a <b>Do...Loop</b> statement. <b>Exit Do</b> transfers control to the statement following the <b>Loop</b> statement. When used within nested <b>Do...Loop</b> statements, <b>Exit Do</b> transfers control to the loop that is one nested level above the loop where it occurs.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><b>Exit For</b></FONT></TD>
<TD><FONT SIZE=2>Provides a way to exit a <b>For</b> loop. It can be used only in a <b>For...Next</b> or <b>For Each...Next</b> loop. <b>Exit For</b> transfers control to the statement following the <b>Next</b> statement. When used within nested <b>For</b> loops, <b>Exit For </b>transfers control to the loop that is one nested level above the loop where it occurs.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><b>Exit Function</b></FONT></TD>
<TD><FONT SIZE=2>Immediately exits the <b>Function</b> procedure in which it appears. Execution continues with the statement following the statement that called the <b>Function</b>.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><b>Exit Sub</b></FONT></TD>
<TD><FONT SIZE=2>Immediately exits the <b>Sub</b> procedure in which it appears. Execution continues with the statement following the statement that called the <b>Sub</b>.</FONT></TD></TR></TABLE>
</BLOCKQUOTE>
<p>
<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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -