帮我看下这个函数那写错了?

qfljm 2004-04-08 06:49:16
<%
Dim s,e
s=2
e="2, 4, 65, 3"

Response.Write Checks(e,s)

Function Checks(str,lv)
Dim i, f
f=Split(str,",")
For i = 0 To UBound(f)
If Cint(f(i)) = lv Then
Checks = True
Exit For
Exit Function
End If
Next
Checks = False
End Function
%>

为何返回的都是False呢.应该是True才对啊
...全文
14 点赞 收藏 5
写回复
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhurenweile 2004-04-08
<%
Dim s,e
s = 2
e = "2, 4, 65, 3"

Response.Write Checks(e,s)

Function Checks(str,lv)
Checks = False
Dim i, f
f = Split(str,",")
For i = 0 To UBound(f)
If Cint(f(i)) = lv Then
Checks = True
Exit Function
End If
Next

End Function
%>
回复
chushicheng 2004-04-08
<%
Dim s,e
s=2
e="2, 4, 65, 3"

Response.Write Checks(e,s)

Function Checks(str,lv)
Dim i, f
f=Split(str,",")
For i = LBound(f) To UBound(f)
If Cint(f(i)) = lv Then
Checks = True
Exit For
Exit Function
End If
Next
Checks = False
End Function
%>

回复
nanyjm 2004-04-08
<%
Dim s,e
s=2
e="2, 4, 65, 3"

Response.Write Checks(e,s)

Function Checks(str,lv)
Dim i, f
Checks = False
f=Split(str,",")
For i = 0 To UBound(f)
If Cint(f(i)) = lv Then
Checks = True
Exit For
Exit Function
End If
Next

End Function
%>
回复
dslion 2004-04-08
你都退出FOR了,永远都没机会退出Function的
回复
TrueAndFalse 2004-04-08
<%
Dim s,e
s = 2
e = "2, 4, 65, 3"

Response.Write Checks(e,s)

Function Checks(str,lv)
Checks = False
Dim i, f
f = Split(str,",")
For i = 0 To UBound(f)
If Cint(f(i)) = lv Then
Checks = True
Exit For
End If
Next

End Function
%>
回复
发动态
发帖子
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
社区公告
暂无公告