Looping statements available in VBScript
Do...Loop: Loops while or until a condition is True
While...Wend: Loops while a condition is True
Syntax:
While condition
[statements]
Wend
For...Next: Uses a counter to run statements a specified number of times.
For Each ...Next: Repeats a group of statements for each item in a collection or each element of an array.
'Do ... While Statement
Count = 1
Do While Count <= 10 msgbox Count Count = Count + 1 Loop Do Statement
Count =1
Do
msgbox Count
Count = Count + 1
Loop While(Count <= 10)
'For...each statement
Dim Names(2)
Names(0) = "Tove"
Names(1) = "Jani"
Names(2) = "Hege"
For each Name in Names
msgbox (Name)
Next
'For statement
for counter = 0 to 5
msgbox "The counter value is "&counter
next
Table of Contents
- Scripting Techniques
- Data Types
- Variables
- Constants
- Conditional Statements
- Build-In-Functions
- Loop Statements
- Sample Scripts
- Comments
- Input Box
- VBScript-Excel Object
- VBScript - MS Word Object
- VBScript Dictionary Object
- VBScript - FSO - Drives
- VBScript - XML Object
- VBScript - FSO - Folders
- VBScript - FSO - Files
- VBScript - Coding Standards
Thursday, September 2, 2010
Subscribe to:
Post Comments (Atom)
Those who do not remember the past are condemned to repeats it. See the link the below for more info.
ReplyDelete#repeats
www.ufgop.org