There are two types of Control Statements VBScript
Statement: Each and every line in VBScript
Let’s see both Conditional control statements and Looping control statements below
Used to execute single statements or set of statements based on conditions.
The following Conditional statements are available in VB Script:
IF STATEMENT: executes a set of statement when a condition is true
IF – ELSE STATEMENT: select one of two sets of statements to execute
IF – ELSEIF STATEMENT: select one of many sets of statements to execute
SELECT CASE STATEMENT: select one of many sets of statements to execute
Click here to see Conditional control statements in detail
LOOPING CONTROL STATEMENTS VBScript:
Looping control statements allow to run a group of statements repeatedly when the condition is true.
Following looping control statements are available in VBScript:
• While…Wend statement – It executes only when a condition is true. Use the Do-Loop statement instead of this.
• Do – Loop While statement – loops while a condition is true
• Do While – Loop statement – It executes one time even if the condition is False
• Do – Loop Until statement – loops until a condition is true
• For…Next statement – runs code a specified number of times
• For Each…Next statement – runs code for each item in a collection or each element of an array
Click here to see looping control statements in detail