[thelist] why doesn't this work? (ASP 2.0)

Rob Smith rob.smith at THERMON.com
Fri Jan 2 10:19:38 CST 2004


Just for SNG, here's my code that generates the
...counter
   Dim counter
	if not Versions.eof then
	   while not Versions.eof 
		counter = counter + 1
		Versions.movenext
	   wend
	   Versions.movefirst
	end if


...what I'm trying to accomplish: (it's a version tracking system)
states desired are:
a) <font color="gray">Prev</font>        | 1 | <a
href="page.asp?version+1">Next</a>
b) <a href="page.asp?version-1">Prev</a> | 2 | <a
href="page.asp?version+1">Next</a>
c) <a href="page.asp?version-1">Prev</a> | 3 | <font
color="gray">Next</font>

   if request.querystring("Version") = 1 then 'we're at the first record
so...
	response.write("<font color=""gray"">Prev</font> | " &
Request.QueryString("Version") & " | <a href=""ModifyaProject.asp?project="
& Project & "&Version="& Request.QueryString("Version")+1 & """>Next</a>")
   elseif cint(trim(request.QueryString("Version"))) >1 and
cint(trim(request.QueryString("Version"))) < trim(counter) then ' we're
beyond the first record
	response.write("<a href=""ModifyaProject.asp?project=" & Project &
"&Version="& Request.QueryString("Version")-1 & """>Prev</a> |  " &
Request.QueryString("Version") & " | <a href=""ModifyaProject.asp?project="
& Project & "&Version="& Request.QueryString("Version")+1 & """>Next</a>")
   elseif  (request.querystring("Version") = counter)   then
	response.write("<a href=""ModifyaProject.asp?project=" & Project &
"&Version="& Request.QueryString("Version")-1 & """>Prev</a> |  " &
Request.QueryString("Version") & " | <font color=""gray"">Next</font>")
   else
	response.write("Error Status: " & request.querystring("Version") & "
" & counter)
   end if


More information about the thelist mailing list