不懂的ASP代码 请问高手这段代码如何解释?

来源:百度知道 编辑:UC知道 时间:2024/06/16 01:39:33
strsql="select count(*) as total from TEACHERSCORE where usertype=2 and TEACHERID='"&teach&"' and depart='"&depart&"'"
set rs=db.execute(strsql)
scoret=rs("total")
scoreshowt=0
if scoret<>0 then
strsql="select * from TEACHERSCORE where usertype=2 and TEACHERID='"&teach&"' and depart='"&depart&"'"
set rs=db.execute(strsql)

for i=1 to scoret
scoredistz=split(rs("score"),"*")
lendl=ubound(scoredistz)
for j=0 to lendl
scoreshowt=scoredistz(j)+cint(scoreshowt)
next
rs.movenext
next
scoreshowt=scoreshowt/scoret
end if
scoreshowt=scoreshowt/colleague*100*colleaguep/100

这是从数据库读取数据的代码。中间用到了两个循环嵌套,但是一些变量没有在当页声明,所以不太清楚这个页面的功能。你最好能结合其它页面才能知道它有什么作用。

你好像是不是发错贴了,哥们,这里是“烦恼-恋爱”我建议你去“电脑-编程中发这个贴子,这里的人都是谈情说爱的,好像不太懂你这个。

strsql="选择从 TEACHERSCORE 计算 (*) 如总计的哪里 usertype=2 和 TEACHERID='"&教&"' 而且离开 ='"&离开&"'"
设定 rs=db.execute(strsql)
scoret=rs(" 总数 ")
scoreshowt=0
如果 scoret<>0 那么
strsql="选择 * 从 TEACHERSCORE 哪里 usertype=2 和 TEACHERID='"&教&"' 而且离开 ='"&离开&"'"
设定 rs=db.execute(strsql)

因为 i=1 对 scoret
scoredistz=劈开 (rs(" 得分 "),"*")
lendl=ubound(scoredistz)
因为 j=0 对 lendl
scoreshowt=scoredistz(j)+cint(scoreshowt)
下一个
rs.movenext
下一个
scoreshowt=scoreshowt/scoret
结束如果
scoreshowt=scoreshowt/同事 *100*colleaguep/100