咋回事啊?

zhouqing2542 2008-04-06 11:40:44
<table width="617" border="0" align="center" cellpadding="0" cellspacing="0">
<%
mytype=request("typeid")
page=request.querystring("page")
if page="" or Not IsNumeric(page) then page=1
set rs =server.CreateObject("adodb.recordset")
sql="select top 9 * from Product where typeid order by cpdate desc"
rs.open sql,conn,1,1

rs.pageSize=9
if rs.eof then



%><tr>
<td width="180" height="22" valign="middle" class="newsstyle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="484" class="font_12_23"> 暂无信息...</td>

</tr>
</table></td>
</tr>
<%
else
i=0
rs.AbsolutePage=page
while not rs.eof and i<rs.PageSize
%><tr>

<%

Set PP = New ImgWHInfo
w1=120
h1=107
pgcount=rsnew.recordcount/3
if (rsnew.recordcount mod 3)=0 then
pgcount=pgcount+1
end if


for i=1 to 3


response.Write("<tr>")


title22=""

title22=rsnew(1)





%>
<td height="177" colspan="3" align="center" valign="top" class="font_12_23"><table width="608" border="0" cellspacing="2">
<tr>
<td width="202"><table width="135" height="140" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="135" height="140" align="center" background="pict/cpbj.jpg"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><%= mysize(rsnew(2)) %></td>
</tr>
</table></td>
</tr>
<tr>
<td height="48" align="center" valign="top" class="zhengwen" style="table-layout: fixed;WORD-BREAK: break-all" ><table width="75%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><span class="zhengwen" style="table-layout: fixed;WORD-BREAK: break-all"><%=title22%></span></td>
</tr>
</table></td>
</tr>
</table></td>
<%
if rsnew.eof then
response.write("</tr>")

exit for
end if
title22=""
rsnew.movenext
next


%>
<td width="188"><table width="135" height="140" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="135" height="140" align="center" background="pict/cpbj.jpg"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><%= mysize(rsnew(2)) %></td>
</tr>
</table></td>
</tr>
<tr>
<td height="48" align="center" valign="top" class="zhengwen" style="table-layout: fixed;WORD-BREAK: break-all" ><table width="75%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><span class="zhengwen" style="table-layout: fixed;WORD-BREAK: break-all"><%=title22%></span></td>
</tr>
</table></td>
</tr>
</table></td>

<%
if rsnew.eof then
respons.write("</tr>")
exit for
end if
rsnew.movenext

title22=""
title22=rsnew(1)


%>
<td width="204"><table width="135" height="140" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="135" height="140" align="center" background="pict/cpbj.jpg"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><%= mysize(rsnew(2)) %></td>
</tr>
</table></td>
</tr>
<tr>
<td height="48" align="center" valign="top" class="zhengwen" style="table-layout: fixed;WORD-BREAK: break-all" ><table width="75%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><span class="zhengwen" style="table-layout: fixed;WORD-BREAK: break-all"><%=title22%></span></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td> <%
if rsnew.eof then
response.write("</tr>")

exit for
end if





title22=""
rsnew.movenext
next


%>



<%
if rsnew.eof then
respons.write("</tr>")

exit for
end if
rsnew.movenext

title22=""
title22=rsnew(1)


%>
<% i=i+1
j=j+1
if j>3 then exit do
rs.movenext
loop
%>
</tr>
<%

wend
end if
%>


错误类型:
Microsoft VBScript 编译器错误 (0x800A040F)
无效的 'exit' 语句
/product.asp, line 217, column 5
exit for
----^


哪个高手看看啥问题. .
...全文
99 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
苍白之月 2008-04-07
  • 打赏
  • 举报
回复
<% 
while not rs.eof
if (rsnew.recordcount mod 3)=0 then pgcount=pgcount+1

for i=1 to 3
if rsnew.eof then exit for
rsnew.movenext
next


if rsnew.eof then exit for
if rsnew.eof then exit for


rsnew.movenext
next

if rsnew.eof then exit for
rsnew.movenext

i=i+1
j=j+1
if j>3 then exit do
rs.movenext
loop

wend
%>


上面就是你的代码基础逻辑了 基本上错了很多地方
hookee 2008-04-07
  • 打赏
  • 举报
回复
才一个for,怎会有2个next? 且有个exit for出现在外层next之外,显然有问题
先写逻辑代码,再插入html就比较清楚了
tantaiyizu 2008-04-07
  • 打赏
  • 举报
回复
for ... next

do while ... loop

while .. wend

乱成一滩,即便调试通过,也不要这样去做。。。
  • 打赏
  • 举报
回复
写的代码不匹配!!!
exit for
这个注意看下匹配
ximyma 2008-04-07
  • 打赏
  • 举报
回复
先用中文写好逻辑语句,再进行优化,进行语句转换,就不会出错了.
peijunfeng 2008-04-07
  • 打赏
  • 举报
回复
for 和 next 不配对

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧