if的一段代码,呵呵,初等的,解释一下,谢谢大家了
我本来是学jsp的,因为临时要做个asp的网站后台,下面这段代码应该是VB之类的,我对VB只是大概了解,一些语法没学过,请大家给我解释一下,谢谢了<!--#include file="inc/setup.asp" -->
<!--#include file="inc/CheckClass.inc.asp" -->
<!--#include file="dbconnect/news.inc.asp" -->
<%
on error resume next
dim pmcount,pageno
'//设置每页新闻数目
pmcount=news_front_count
dim rs,sql
set rs=server.createobject("adodb.recordset")
s_keyword = RtnReplaceString(trim(request("keyword")))
s_cataid = RtnReplaceInt(trim(request("cataid")),0)
sub getNewsBoardTree()
set rsf=server.CreateObject("adodb.recordset")
sqlf="Select * from newscata order by rootid"
rsf.Open sqlf,conn,1,3
do while not rsf.EOF
tempcataStr="<option value='"&trim(rsf("id"))&"'"
if trim(rsf("id")) = s_cataid then tempcataStr = tempcataStr&" selected"
tempcataStr = tempcataStr&">"
tempcataStr = tempcataStr&" | |"
for i=1 to rsf("level")-1
tempcataStr = tempcataStr&" |"
next
tempcataStr = tempcataStr&"_"&trim(rsf("title"))&"</option>"
Response.Write tempcataStr
rsf.MoveNext
loop
rsf.Close()
set rsf=nothing
end sub
%>
这段代码放在HTML代码的上面