回 帖 发 新 帖 刷新版面

主题:下标越界问题

请问各位高人,以下代码出现:  下标越界: 'i' 
请问错误在哪呢??谢谢!

<% 
str=""
str=str&"<form>"
str=str&"<table width=""390"" height=""70"" width=""390"" height=""70"" border=""1"" cellspacing=""1""  cellpadding=""1"">"
str=str&"<%"
str=str&"For i=0 to ubound(CCcart,2)"
str=str&"if CCcart(CC_PRODUCTID,i) <> """" then"
str=str&"%"&">"
str=str&"<tr align=""center"" valign=""middle"">"
str=str&"<td height=""15"" class=""style1 style9"">" & CCcart(CC_Name,i) & "</td>"
str=str&"<td height=""15"" class=""style1 style9"">" & CCcart(CC_Price,i) & "</td>"
str=str&"<td height=""15"" class=""style1 style9"">" & CCcart(CC_Quantity,i) & "</td>"
str=str&"<td height=""15"" class=""style1 style9"">" & CCcart_LineTotal & "</td>"
str=str&"<td height=""15"" class=""style1 style9"">&nbsp;</td>"
str=str&"</tr>"
str=str&"<%"
str=str&"end if"
str=str&"next"
str=str&"%"&">"
str=str&"</table>"
str=str&"</form>"

回复列表 (共5个回复)

沙发

你需要告诉别人哪一行出现了错误。

板凳

str=str&"<td height=""15"" class=""style1 style9"">" & CCcart(CC_Name,i) & "</td>"

------------浏览器中显示这行出错

3 楼

你好像ASP编程网的版主吧!呵呵

4 楼

i的初始值在哪?
是str=str&"For i=0 to ubound(CCcart,2)"这里面的吗?
但它是一个字符串,赋值没执行咯

5 楼

那请问这段代码我该如何改写才能让其执行赋值呢?谢谢

我来回复

您尚未登录,请登录后再回复。点此登录或注册