asp中数组函数问题。麻烦看下
MyArry=Array("1001","1002","1003")str="1002"functioncheckarry(arry(),str)fori=lbound(...
MyArry=Array("1001","1002","1003")
str="1002"
function checkarry(arry(),str)
for i=lbound(myarry) to ubound(myarry)
if myarry(i)=str then
'response.write("success")
checkarry=true
exit for
end if
Next
end function
if checkarry(MyArry(),str)=true then
response.Write("y")
else
response.Write("N")
end if
Microsoft VBScript 运行时错误 (0x800A0009)
下标越界: 'MyArry' 展开
str="1002"
function checkarry(arry(),str)
for i=lbound(myarry) to ubound(myarry)
if myarry(i)=str then
'response.write("success")
checkarry=true
exit for
end if
Next
end function
if checkarry(MyArry(),str)=true then
response.Write("y")
else
response.Write("N")
end if
Microsoft VBScript 运行时错误 (0x800A0009)
下标越界: 'MyArry' 展开
展开全部
改成这个样子就可以了:
<%
MyArry=Array("1001","1002","1003")
str="1002"
function checkarry(arry,str)
for i=lbound(arry) to ubound(arry)
if arry(i)=str then
'response.write("success")
checkarry=true
exit for
end if
Next
end function
if checkarry(MyArry,str)=true then
response.Write("y")
else
response.Write("N")
end if
%>
<%
MyArry=Array("1001","1002","1003")
str="1002"
function checkarry(arry,str)
for i=lbound(arry) to ubound(arry)
if arry(i)=str then
'response.write("success")
checkarry=true
exit for
end if
Next
end function
if checkarry(MyArry,str)=true then
response.Write("y")
else
response.Write("N")
end if
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询