Solved vbScript Enter Array from InputBox

November 20, 2012 at 16:47:29
Specs: Windows 7
I'm trying to create a standalone vbScript that will take values from an InputBox via vbScript and add them to an array. Specifically I want to allow a person to enter URLs so that a script being used will loop through them. I have a functioning vbScript already if I were to manually add the URLs to the vbScript directly, however, I need to provide this to an end user that will enter different URLs to loop through as needed. Unfortunately vbScript is my only option to use in this case due. Here is my script that is working with a static Array. I have found very few details on doing what I'm looking for and no luck implementing the couple of suggestions I've found so far. Any help is greatly appreciated.

Dim oIE, i

Dim WebPage(3)
WebPage(0) = ""
WebPage(1) = ""
WebPage(2) = ""

Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True

For i = 0 To ubound(WebPage)-1
oIE.Navigate2 WebPage(i)
WScript.Sleep 10000
WScript.Sleep 10000

See More: vbScript Enter Array from InputBox

Report •

November 20, 2012 at 17:47:52
✔ Best Answer
This seems to do what you want:
'==== begin vbscript
dim t()
do while len(a)>0
redim preserve t(i)
'=== just display-array
for j=1 to i
wscript.echo t(j)
'====== end vbscript snippet

Report •

November 21, 2012 at 09:30:23
Perfect! Exactly what I needed, thank you.

Report •

Related Solutions

Ask Question