asp中这个循环怎样传递变量

来源:百度知道 编辑:UC知道 时间:2024/06/05 21:53:50
<tr><%a1="中国"
a2="香港"
...
a30="巴拉圭"
for i = 1 to 30%>
<td><%=guojia></td>
<%next%>
</tr>

输出效果:
<tr>
<td>中国</td><td>香港</td>....<td>巴拉圭</td>
</tr>

请问guojia怎样获得a1~a30的数值

<%
dim a(31)
a(1)="中国"
a(2)="香港"
a(3)="巴拉圭"
...
s=""
for i = 1 to 30
s=s & "<td>" & a(i) &"</td>"
next
response.write s
%>

a那儿也可以简单形式:

a=split(",中国,香港,巴拉圭,....",",")

for i = 1 to 30%>
<td><%=a&i></td>
<%next%>

dim i,a()

a(0)="中国"
a(1)="中国香港"
……
a(29)="巴拉圭"
response.write("<tr>")
for i=0 to 29
response.write("<td>"&a(i)&"</td>")
next
response.write("</tr>")