VBScript – Loops

Step 1. Introduction about loop
Step 2. Types of loop available in VBS
Step 3. For Loop
Step 4. For each Loop
Step 5. While…. Wend Loop
Step 6. Do while Loop
Step 7. Do Until Loop
Step 8. Loop Control Statements
Step 9. Exit For Statement
Step 10. Exit Do Statement
Step 11. Visit GoLearningBus.Com for more “www.vbsedit.com” training

1.Introduction about loop

A loop statement allows us to execute a statement or group of statements multiple times and following is the general from of a loop statement in VBScript.

To play this tour at your “www.vbsedit.com” website install guideme player from guideme.io and click on player icon at right bottom of “www.vbsedit.com” website.

Go to Toparrow-1

2.Types of loop available in VBS

VBScript provides the following types of loops to handle looping requirements.
1) For Loop,
2) For each Loop,
3) While.. Wend Loop,
4) Do While loop,
5) Do until loop.

Go to Toparrow-1

3.For Loop

Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable. you can see also see example here

Go to Toparrow-1

4.For each Loop

This is executed if there is at least one element in group and reiterated for each element in a group.

Go to Toparrow-1

5.While…. Wend Loop

This tests the condition before executing the loop body.

Go to Toparrow-1

6.Do while Loop

The do..While statements will be executed as long as condition is True.(i.e.,) The Loop should be repeated till the condition is False.

Go to Toparrow-1

7.Do Until Loop

The do..Until statements will be executed as long as condition is False.(i.e.,) The Loop should be repeated till the condition is True.

Go to Toparrow-1

8.Loop Control Statements

Loop control statements change execution from its normal sequence. When execution leaves a scope, all the remaining statements in the loop are NOT executed.

VBScript supports the following control statements.
1) Exit For Statement,
2) Exit Do Statement

Go to Toparrow-1

9.Exit For Statement

Terminates the For loop statement and transfers execution to the statement immediately following the loop

Go to Toparrow-1

10.Exit Do Statement

Terminates the Do While statement and transfers execution to the statement immediately following the loop

Go to Toparrow-1

11.Visit GoLearningBus.Com for more “www.vbsedit.com” training

Visit GoLearningBus.Com for more “www.vbsedit.com” guided tours and training.
For only $10 you can access more than 300 apps for a lifetime of learning and training.

Leave a comment