'Using Integer Array
A(0) = 10
A(1) = 20
A(2) = 30
For i = 0 to 2
msgbox A(i)
Next
'Using String Array
StringArray(0) = "ArrayVariable1"
StringArray(1) = "ArrayVariable2"
StringArray(2) = "ArrayVariable3"
For i = 0 to 2
msgbox StringArray(i)
Next
'Split a string
Dim StringName, SplitString
StringName = "My name is xxx. I studied 10th class. I completed intermediate"
SplitString = split(StringName, " ")
For i = 0 to ubound(SplitString(i))
msgbox SplitString(i)
Next
'or
For i = LBound(SplitString) to UBound(SplitString)
msgbox SplitString(i)
Next
' Gets the Current Date, Current Time
Dim TodaysDate, CurTime, CurDateTime
TodaysDate = Date
CurTime = Time
CurDateTime = Now
msgbox "Today's Date "&TodaysDate
msgbox "Current Time "&CurTime
msgbox "Current Date and Time "&Now
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
Tuesday, September 21, 2010
Subscribe to:
Post Comments (Atom)
How to capture the VBscript runtime error or success messaged to file as log ?
ReplyDelete