This is my first post here but I've been reading here a while and have developed a bit of a problem I thought I'd seek some advice on.
As the subject suggests, I'm building a page with ASP and using VBScript as my language. I'm relatively new to programming in general so forgive me if I'm way off base here somewhere.
What I'm doing is reading file names from a directory on my server and storing them as one long string in a variable. The filenames are actually a relative path like "/folder/filename.jpg." These are being brought in with the FileSystemObject and loaded in to the variable with a loop.
Expand|Select|Wrap|Line Numbers
- for each item in folder.Files
- url = MapURL(item.path)
- ' store the file names
- if fileList = NULL Then
- fileList = url & ","
- else
- fileList = fileList & url & ","
- end if
- next
Expand|Select|Wrap|Line Numbers
- response.write(fileList)
- response.write("<br><br>")
- newList = split(fileList,",")
- for each i in newList
- response.write(newList(i) & "<br>") '<--- this line throws the error
- next
But, when I try to write the values saved in the array I get an error "Type mismatch: '/testfolder/testimg.jpg'"
I've tried quite a bit but obviously haven't been able to get it working. What am I missing here?
Not that I think it matters for this particular issue, but I'm running IIS on XP Pro.
Thanks in advance!
Edit --> response.write(fileList) prints all the relative paths just fine just like the code looks like it should.
/folder/testimage1.jpg,/folder/testimage2.jpg,/folder/testimage3.jpg,/folder/testimage4.jpg and on and on.