Java Programs

<% ' Set up constsnts. Const constForReading = 1 Const constTristateFalse = 0 Const numColumns = 3 Const numRows = 4 ' Dimension local variables. Dim fsoObject ' FileSystemObject Dim tsObject ' TextStreaming object Dim filePath ' Holds path to text file Dim textBuffer Dim programList(50) Dim i, j ' Loop variable Dim numPrograms ' Total number of programs in the list file Dim currentPage ' dim numThumbs ' Number of thumbnails per page. dim columnCounter numPrograms = 0 numThumbs = numColumns * numRows ' Get the page variable, if it has been passed to the page this time. currentPage = int(Request.QueryString("page")) ' Create the File System Object. Set fsoObject = Server.CreateObject("Scripting.FileSystemObject") filePath = Server.MapPath("list.txt") 'Response.Write filePath ' Open the text file Set tsObject = fsoObject.OpenTextFile(filePath, constForReading) ' Read in program list do while tsObject.AtEndOfStream = false programList(numPrograms) = tsObject.ReadLine numPrograms = numPrograms + 1 loop ' REDIRECT 'Response.Redirect "http://www.coolbubble.com/programs.asp" 'targetframename.location.href="http://www.coolbubble.com/programs.asp" ' Draw page number links Response.Write("

") call(makePageLinks) Response.Write("

") ' draw thumbnails Response.Write("

") for i = 0 to numThumbs-1 j = i + (currentPage*numThumbs) if j") end if next Response.Write("

") Response.Write("

") Response.Write("There are currently " & numPrograms & " java programs in the list.") Response.Write("

") ' Close file and clean up. tsObject.Close Set tsObject=Nothing Set fsoObject=Nothing ' Subroutines sub makeLink(linkName) Dim outputText outputText = "" & linkName & "" response.write("
" & outputText ) end sub sub makeThumbnailLink(linkName) Dim outputText outputText = "" & "" & linkName &"" & "" response.write(outputText) end sub ' Creates a line of numbers linking all of the program pages. sub makePageLinks dim numPages, i, outputText numPages = numPrograms / numThumbs 'response.write("
makePageLinks.numPages = " & numPages & "
") 'response.write("
makePageLinks.currentpage = " & currentPage & "
") response.write("Page: ") for i = 0 to numPages if (currentPage = i) then response.write("" & i+1 & " ") else response.write("" & i+1 & " ") end if next end sub %>

return to coolbubble