注册 登录
编程论坛 ASP技术论坛

急问:这段小小的代码为什么出错?

sass 发布于 2008-07-02 11:47, 960 次点击
我想把M1中的数,一个个从xuan1中过滤掉!但不知道为什么,只能过滤掉第一个数,其它的数就不会继续过滤!??!!?

<%
M1="11 14 19 24 29"
M1=split(trim(M1))
xuan1="35 31 33 32 29 11 25 24 22 10 30 01 34 23 21 13 06 27 19 14"
for a=0 to ubound(M1)
        aa=M1(a)
        response.write aa & "<BR>"
        if instr(xuan1,aa)>0 then
           a=instr(xuan1,aa)
          xuan1=trim(left(xuan1,a-1) & right(xuan1,(len(xuan1)-(a+2))))
          response.write xuan1 & "<BR>"
        end if
  
       next
       response.write xuan1
%>
2 回复
#2
xiapi2008-07-02 12:00
M1="11,14,19,24,29"
M1=split(trim(M1),",")
#3
sass2008-07-02 12:20
[bo][un]xiapi[/un] 在 2008-7-2 12:00 的发言:[/bo]

M1="11,14,19,24,29"
M1=split(trim(M1),",")


已经解决了,原因是在再往下的代码段中xuan1没有处理好.
1