Follow this blog to get updated on RESOLVING SOLVING WORKAROUNDS FOR tricky issues using automation.
Disclaimer: I am not responsible for any damage or loss or profit on using this blog posts.
Web UI Automation with Windows PowerShell
Web UI Automation with HP QTP
Web UI Automation with OATS
Web UI Automation with Selenium
Desktop UI Automation
Windows Applications Automation with QTP
qtp windows application automation
Blog Free Travel information in India
Saturday, July 31, 2010
VBSCRIPT > REDIM PRESERVE clear example
VBSCRIPT > REDIM PRESERVE example
THROWS - subscript out of error
dim a()
i=0
for i =0 to 5
a(i)=i ' subscript out of error at this line
next
----------------------
dim a()
i=0
for i=0 to 5
REDIM a(i)
a(i)=i
next
'output
for i=0 to ubound(a)
msgbox a(i)
next
'OUTPUT : 5
' Where are the values 0,1,2,3,4 ??? strange ??
' these values have been overwritten each time and only last updated value is stored in a(i)
'TO PRESERVE Previously stored value in array, we use -PRESERVE keyword as follows
dim a()
i=0
for i=0 to 5
REDIM PRESERVE a(i)
a(i)= i
Next
'to retrieve output
for i=0 to ubound(a)
msgbox a(i)
next
'OUTPUT : 0,1,2,3,5
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment