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
Tags:
Conditional statements
VBScript
VBScript Statements
wend
while
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

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: