帮我看看这小段ASP代码的错误!!

来源:百度知道 编辑:UC知道 时间:2024/09/21 23:36:53
<%

msg=application("msg")
for i=1 to 10
response.write msg(i)
next
%>
偶实在是看不出有什么问题!!!
老是报错 response.write msg(i)

msg只是一个变量值,不是数组。所以用response.write msg(i)就报错了。
你可以改成这样,或许可以。

msg_=application("msg")
msg=split(msg_,",") '把它以逗号分开,成为数组
for i=1 to 10 '这里最好不要这样写,会造成下标越界,要用ubound(msg)。
response.write msg(i)
next