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
• Re: How to concatenate a string and a variable using perl?
• Re: repaint() slow performence..
• Re: How Can I Get The Height Of A Hidden <div>?
• Re: Firefox/IE doctype problem.
• Re: Plz its urgent:validation code
• Re: Write text strings to Serial Port
• Re: Error configuring webservice identity in reporting services 2005
• Re: sort hash by value, numerically
• Re: Accessing user control in master page from any content page


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-2010