- VBScript - Date
- VBScript - Arrays
- VBScript - Strings
- VBScript - Numbers
- VBScript - Cookies
- VBScript - Events
- VBScript - Loops
- VBScript - Decisions
- VBScript - Operators
- VBScript - Constants
- VBScript - Variables
- VBScript - Placement
- VBScript - Enabling
- VBScript - Syntax
- VBScript - Overview
- VBScript - Home
VBScript Advanced
- VBScript - Misc Statements
- VBScript - Error Handling
- VBScript - Reg Expressions
- VBScript - Object Oriented
- VBScript - Dialog Boxes
- VBScript - Procedures
VBScript Useful Resources
- VBScript - Discussion
- VBScript - Useful Resources
- VBScript - Quick Guide
- VBScript - Questions and Answers
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
VBScript - Loops
There may be a situation when you need to execute a block of code several number of times. In general, statements are executed sequentially: The first statement in a function is executed first, followed by the second, and so on.
Programming languages provide various control structures that allow more comppcated execution paths. 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.
VBScript provides the following types of loops to handle looping requirements. Cpck the following pnks to check their detail.
Loop Type | Description |
---|---|
Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable. | |
It is executed if there is at least one element in group and reiterated for each element in a group. | |
It tests the condition before executing the loop body. | |
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. | |
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. |
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. Cpck the following pnks to check their detail.
Control Statement | Description |
---|---|
Terminates the For loop statement and transfers execution to the statement immediately following the loop | |
Terminates the Do While statement and transfers execution to the statement immediately following the loop |