Hi,
I have a problem. I have a files collection. It holds all the files in a directory. I want to be able to only print out the first 5. I've tried to add the element numbers to the collection, but I get an error. Is there a way to access different elements in a collection w/o having to loop thru and see every one of them?
Mike
Below is the section of code that gives me problems. I can loop thru and print them all, but I don't want that.
############################################################
set array2=obfolder.Files
'This line here won't work. How can I access the first one?
response.write("<h2><b>" & array2(0) & "</b></h2>"
for each file in array2
response.write("<img src=graphics/" & file.name & " width=50 height=50 alt=" & file.name &">"
response.write(file.name&"<br>"
next
############################################################
I have a problem. I have a files collection. It holds all the files in a directory. I want to be able to only print out the first 5. I've tried to add the element numbers to the collection, but I get an error. Is there a way to access different elements in a collection w/o having to loop thru and see every one of them?
Mike
Below is the section of code that gives me problems. I can loop thru and print them all, but I don't want that.
############################################################
set array2=obfolder.Files
'This line here won't work. How can I access the first one?
response.write("<h2><b>" & array2(0) & "</b></h2>"
for each file in array2
response.write("<img src=graphics/" & file.name & " width=50 height=50 alt=" & file.name &">"
response.write(file.name&"<br>"
next
############################################################