新微赢技术网

标题: 請教為何彈出超出范圍的錯? [打印本页]

作者: 火箭筒︻$▅    时间: 2010-1-8 04:45
标题: 請教為何彈出超出范圍的錯?
<%
dim za1(3),za2(10)
za1(0) = "fdas,t,t,f,f"
za1(1) = "fdreqt,f,t,f,f"
for zi = 0 to ubound(za1)
za2 = split( za1(zi),",") ‘這句有error
for zj = 0 to ubound( za2)
response.write za2(zj) & " --- "
next
response.write "<br>"
next

%>
請只回第三樓的問題就可以了,多謝
作者: 僞o碬侎〾    时间: 2010-1-8 04:45
za2 = split( za1(zi),",") ‘這句有error

把za2换成别的 ...za2貌似已经被定义了 ...

如: za3 = split( za1(zi),",")
作者: 兮哩糊涂の斗    时间: 2010-1-8 04:45
<%
dim za1(3),za2
za1(0) = "fdas,t,t,f,f"
za1(1) = "fdreqt,f,t,f,f"
for zi = 0 to ubound(za1)
'za2 = null
za2 = split( za1(zi),",")
for zj = 0 to ubound( za2)
response.write za2(zj) & " ---|| "
next
response.write "<br>"
za2 = null
%>

<td> <%=za2(0)%></td>
<td> <%=za2(1)%></td>

<% '加入這部分就有error,為何?超出范圍
next
%>
作者: 十六夜的月    时间: 2010-1-8 04:45
<%
dim za1(3),za2
za1(0) = "fdas,t,t,f,f"
za1(1) = "fdreqt,f,t,f,f"
for zi = 0 to ubound(za1)
if za1(zi) <> "" And Not IsNull(za1(zi)) Then
za2 = null
za2 = split( za1(zi),",")
for zj = 0 to ubound( za2)
response.write za2(zj) & " ---|| "
next
response.write "<br>"
'za2 = null
%>
<!-- 下面这样写当ZA2的长度小于2 时会出错 -->
<TR>
<td> <%=za2(0)%></td>
<td> <%=za2(1)%></td>
</TR>
<% '加入這部分就有error,為何?超出范圍
end If
next
%>
作者: 森林的眼泪    时间: 2010-1-8 04:45
多謝版主,明白是怎么回事了。
作者: 人偶娃娃    时间: 2010-1-8 04:45
呵呵,不好意思,我是有一個這樣的問題:
一個一維數組,每個元素由一個字符串組成,此字符串又是由一系列由","分隔的字符湊成。
現想用一張二維表格將這些由“,”分隔開的字符填入,每一行是一維數組的一個元素,行中每一格,就是具體由“,”分開的那些短字符串:舉例來說:
aa是一維數組:(數據動態生成,所以不能寫定)
aa(1) = "fdsaf,tete,fdre324,t3454,45"
aa(2) = "t4e54g,t54,5436tgr,fdsa,6555765"
現想讓它們顯示成:
<tr><td>fdsaf</td><td>tete</td><td>fdre324</td><td>t3454</td></tr>
<tr><td>t4e54g</td><td>t54</td><td>5436tgr</td><td>fdsa</td><td>6555765</td></tr>

多謝
作者: √死胖子    时间: 2010-1-8 04:45
......... 你这些代码写得没头没脑的 ... 我实在是想像不出来什么诡异的 程序需要这么来写 .....




欢迎光临 新微赢技术网 (http://bbs.weiying.cn/) Powered by Discuz! X3.2