PDA

View Full Version : ASP, VBScript, and Arrays


Pellet
17-Aug-2004, 09:48
Morning all,

just having a small issue, but can't seem to find anything by googling..

on page1.asp i've created a picklist from a list of files(can select multiple - hence the array later). name = "Files"

On page2.asp i call it:

sText = request.form("File")

MyList = Split(sText, ",")

For Each sLine in MyList

' Now here's the rub:

response.write sline

Next

displays the individual text files (%%%%.txt) for example...

however :
strpath = "w:\xx\xxx\xxx\"
MyList = Split(sText, ",")

For Each sLine in MyList
strLine = strpath & sLine
set objTS = strLine.OpenAsTextStream(ForReading, TristateFalse)
Next

Errors out when i try to open them as a textstream "Object required - w:\xx2xxx\xx"

but appears to be cut off, as it's not displaying the full path...
any ideas what i've done wrong?

Thanks in advance!

Pellet
17-Aug-2004, 10:10
No worries, sorted it:

set f = objFSO.getfile(strLine)
set objTS = f.OpenAsTextStream(ForReading, TristateFalse)