I have a page with code to find images in a folder meeting certain
criteria and displaying them (THANKS JIM). Here's the code:
==========================================
<%@LANGUAGE="VBSCRIPT"%>
<%
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Dim objFolder
Set objFolder = objFSO.GetFolder(Server.Mappath("images/propimages/thumb"))
%>
<HTML>
<HEAD>
<TITLE>View Directory</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
</HEAD>
<BODY bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080"
alink="#FF0000">
<TABLE width="100%" cellpadding="2">
<TR>
<TD align="center" height="45"><FONT color="#3333FF"><B>Dynamic list of
files:
<%= objFolder.Name %><BR>
</B></FONT></TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD> <B>
<%
Dim objFile
For Each objFile in objFolder.Files
ShortName = Left(objFile.Name,5)
If ShortName = "DARHS" Then
Response.Write "<img src='images/propimages/thumb/"&objFile.Name&"'>"&
objFile.Name "</> (" & objFile.Size & " bytes)<BR>"
End If
Next
Set objFolder = Nothing
Set objFile = Nothing
Set objFSO = Nothing
%>
</B></TD>
</TR>
</TABLE>
</BODY>
</HTML>
=================================================
What I would like to do now, is have the images display in rows and columns.
Since the number of images meeting the criterion is not initially known, the
page has to create the table structure on the fly. Thats what I assume
anyway. Is there anyone who knows how to make this happen? Thanks,
Chris
<table border="0">
<%
dim colcount, maxcol
colcount=1
maxcol=3
// maximum columns = 3, we start at column 1
For Each objFile in objFolder.Files
ShortName = Left(objFile.Name,5)
If ShortName = "DARHS" Then
if colcount=1 then
response.write "<tr>"
end if
Response.Write "<td><img
src='images/propimages/thumb/"&objFile.Name&"'>"&
objFile.Name "</> (" & objFile.Size & " bytes)</td>"
colcount=colcount+1
if colcount=maxcol then
colcount=1
response.write "</tr>"
end if
End If
Next
%>
That worked like a champ. I appreciate the help.
Chris
"Tony V" <nospam...@mod-soft.com> wrote in message
news:#QXlPOFJCHA.2984@tkmsftngp13...