codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Help with filesystem object & displaying in a table  serafina at 12:43 on Tuesday, October 18, 2005
 

Hi i am using the filesystem object to retrieve a list of files - well graphics actually which I want to display in a table with 3 columns & then however many rows

I can display the list no problem
Its getting the table to break after 3 cells and create a new row
I am trying this code

Can anyone help please ?
<%
Dim iCurrentCell
iCurrentCell = 1 ( i though i could use this to count number of cells & then get a new row !)

Dim myFSO, myFolder, myFile, strPath
strPath=Server.MapPath ("/graphics/baby")
Set myFSO = Server.CreateObject("Scripting.FileSystemObject")
Set myFolder = myFSO.GetFolder(strPath)
Response.Write "The files in <b>" & myFolder.Name & "</b> Folder are: <br> <br>"%>
<table border='1'>
<tr>
<%
For Each myFile in myFolder.Files
Response.Write "<td>" & myFile.Name & "<td>"
iCurrentCell = iCurrentCell + 1
If iCurrentCell > 3 then
Response.Write(" </tr> ")
iCurrentCell=1
End if

Next

%>

</table>

Yours hopefully



  Re: Help with filesystem object & displaying in a table  Jeff Anderson at 19:07 on Sunday, November 27, 2005
 

serafina - looks about right, except shouldn't it be:



If iCurrentCell > 3 then
Response.Write(" </tr><tr> ")
iCurrentCell=1
End if









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
• C++
• Re: refresh parent after closing pop up window
• Dynamic Insertion
• Date and Time function around the world???
• Significant Factors
• Perl array access
• Re: huffman encoding and decoding in C++...
• Perl One Liner: Replace {(
• Re: html including php, accessing the functions


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2009