读书人

怎么写这样的函数

发布时间: 2012-10-16 09:57:37 作者: rapoo

如何写这样的函数啊
h=1
i=3,4,7,22,11,8,1,556,1211,6543,2134

如果判断i中有h的数字

[解决办法]
<%
h="1"
i="3,4,7,22,11,8,1,556,1211,6543,2134"
h=","&h&","
ii=","&i&","
if instr(ii,hh)>0 then
response.write "有"
else
response.write "无"
end if
%>

[解决办法]
什么叫自己写的函数?你不用vbs,自己开发一种语言就可以了
[解决办法]
<%
h=1
i=3,4,7,22,11,8,1,556,1211,6543,2134
if myInstr(i,h) then
response.write "有"
else
response.write "无"
end if

%>
<%
function myInstr(str1,str2)
temp=false
arr=split(str1,",")
for i=0 to ubound(arr)
if arr(i)=str2 then
temp=true
exit for
end if
next
myInstr=temp
function
%>
[解决办法]
适合....
[解决办法]
其实,二楼已经不错的了。只是写成函数而已。
[解决办法]

探讨

谢谢楼上, 我说的是自己写函数 你用的instr函数我也知道, 自己写的函数有吗

读书人网 >ASP

热点推荐