VBScript Statements: Explanation of the While … Wend Statement - The VBScript Network and Systems Administrator's Cafe

The VBScript Network and Systems Administrator's Cafe

Aug 9 2008   1:57AM GMT

VBScript Statements: Explanation of the While … Wend Statement



Posted by: Jerry Lees
VBScript, while, VBScript Statements, Conditional statements, wend, while wend

The While conditional statement is useful because it allows you to repeat a block of code as long as a conditional test is True, rather than just a simple number of times. It is useful in situations where you need to loop through code, but do not know how many times yo need to run the portion of code.
 
Keep in mind that you must end While statements with a Wend statement.

Here is an example:

test =0
While test<100
     test = test +1
     Wscript.echo test
Wend


 

Comment on this Post


You must be logged-in to post a comment. Log-in/Register