 




<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The VBScript Network and Systems Administrator&#039;s Cafe &#187; do until</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/tag/do-until/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator</link>
	<description></description>
	<lastBuildDate>Tue, 11 Oct 2011 18:36:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>VBScript Statements: Explanation of the Do Loop Statement</title>
		<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/vbscript-statements-explanation-of-the-do-loop-statement/</link>
		<comments>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/vbscript-statements-explanation-of-the-do-loop-statement/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 22:19:20 +0000</pubDate>
		<dc:creator>Jerry Lees</dc:creator>
				<category><![CDATA[Conditional statements]]></category>
		<category><![CDATA[do loop]]></category>
		<category><![CDATA[do until]]></category>
		<category><![CDATA[do while]]></category>
		<category><![CDATA[until]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[VBScript Statements]]></category>
		<category><![CDATA[vbscriptstatements]]></category>
		<category><![CDATA[while]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/vbscript-statements-explanation-of-the-do-loop-statement/</guid>
		<description><![CDATA[The Do &#8230; Loop statement is very useful (like, for &#8230; next and Select &#8230; case) to execute a block of code more than once. However, where it differs from the other two is that the Do &#8230; Loop statement executes the code as long as (while) a condition is true or until a condition [...]]]></description>
				<content:encoded><![CDATA[<p>The Do &#8230; Loop statement is very useful (like, for &#8230; next and Select &#8230; case) to execute a block of code more than once. However, where it differs from the other two is that the Do &#8230; Loop statement executes the code as long as <em>(<strong>while</strong>) </em>a condition is true or <em><strong>until </strong></em>a condition becomes true.</p>
<p>Typical uses of a Do &#8230; Loop are in cases where you may not know how many times you need to execute the code section because it could vary from situation to situation, like when reading in a file or taking in keyboard input.</p>
<p>In this example of a Do While Loop, we check to see if a variable is less than 10 and if not continue to run the code in the loop. (<em>Notice how when x = 10 the code <strong>does not</strong> run</em> and at the end x =10?)</p>
<p><font size="2"><font face="arial, helvetica">x = 0<br />
</font></font><font size="2" face="arial, helvetica"><span class="CODE">Do While x&gt; 10<br />
Wscript.Echo(&#8220;X = &#8221; &amp; x)<br />
x= x + 1<br />
Loop<br />
</span></font><font size="2" face="arial, helvetica"><span class="CODE">Wscript.Echo(&#8220;X is now &#8221; &amp; x)</span></font></p>
<p>In this example of a Do Until Loop, we check to see if a variable is greater than 10, but use the until condition to run the loop. (Notice how when X = 10 the code <strong>does </strong>run and at the end x=11?)</p>
<p>x = 0<br />
Do Until x &gt; 10<br />
Wscript.Wcho(&#8220;X = &#8221; &amp; x)<br />
x= x + 1<br />
Loop<br />
Wscript.Echo(&#8220;X is now &#8221; &amp; x)</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/vbscript-statements-explanation-of-the-do-loop-statement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
