|
Thoughts <% dim fso, read, thoughtRequest, title, titles(), thought, thoughts(), titleAndThought, i thoughtRequest = request.QueryString("thought") Set fso = Server.CreateObject("Scripting.FileSystemObject") Set read = fso.OpenTextFile(Server.MapPath("thoughts\thoughts.txt"), 1) titleAndThought = split(read.ReadAll, "~~") i=3 do until i > ubound(titleAndThought) 'on error resume next Redim titles(i), thoughts(i) titles(i) = titleAndThought(i) thoughts(i) = titleAndThought(i+1) if lcase(thoughtRequest) = lcase(titles(i)) then if not titles(i) = "File_End" then response.write("· " &titles(i)& " ") & vbcr thought = thoughts(i) end if else if not titles(i) = "File_End" then response.write("" &titles(i)& " ") & vbcr end if end if i = i+2 loop read.Close Set read=Nothing Set fso=Nothing %> |
<%
if thoughtRequest = "default" or thoughtRequest = "" then
response.write("On the left is a list of thoughts. Please choose the thought that you would like to read.")
else
if not thought = "" then
response.write(""&thoughtRequest&" "&thought & " ") & vbcr end if end if %> |
|