📄 vbs573.htm
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML><HEAD><TITLE>Do...Loop 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="Do statement,Loop,Until,While,loops,Exit Do,program control,control structures,conditional execution,execution conditional,repeating instructions,instructions repeating,execution,instructions"><META NAME="Description" CONTENT="Do...Loop 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>Do...Loop 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="vbs574.htm">See Also</A></FONT>
<hr noshade size=1>
<H5>Description</H5>
<BLOCKQUOTE>Repeats a block of statements while a condition is <b>True</b> or until a condition becomes <b>True</b>.</BLOCKQUOTE>
<H5>Syntax</H5>
<BLOCKQUOTE><b>Do </b>[{<b>While</b> | <b>Until</b>} <i>condition</i>]<BR>
[<i>statements</i>]<BR>
[<b>Exit</b> <b>Do</b>]<BR>
[<i>statements</i>]<BR>
<b>Loop</b>
<P>Or, you can use this syntax:<P>
<b>Do</b><BR>
[<i>statements</i>]<BR>
[<b>Exit</b> <b>Do</b>]<BR>
[<i>statements</i>]<BR>
<b>Loop</b> [{<b>While</b> | <b>Until</b>} <i>condition</i>]<P>
The <b>Do...Loop</b> statement syntax 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>condition</i></FONT></TD>
<TD><FONT SIZE=2><A HREF="vbs0.htm#defNumericExpression">Numeric</A> or <A HREF="vbs0.htm#defStringExpression">string expression</A> that is <b>True</b> or <b>False</b>. If <i>condition</i> is <A HREF="vbs0.htm#defNull"><B>Null</B></A>, <i>condition</i> is treated as <b>False</b>.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>statements</i></FONT></TD>
<TD><FONT SIZE=2>One or more statements that are repeated while or until <i>condition</i> is <b>True</b>.</FONT></TD></TR></TABLE></BLOCKQUOTE>
<H5>Remarks</H5>
<BLOCKQUOTE>The <b>Exit Do</b> can only be used within a <b>Do...Loop</b> control structure to provide an alternate way to exit a <b>Do...Loop</b>. Any number of <b>Exit Do</b> statements may be placed anywhere in the <b>Do...Loop</b>. Often used with the evaluation of some condition (for example, <b>If...Then</b>), <b>Exit Do</b> transfers control to the statement immediately following the <b>Loop</b>.
<P>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.</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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -