在循环中断掉不连续的。

a=#(1,2,3,4,5,6,8)
cc =#()
v=a.count-1
for i in  1 to v do (
      s = a[i]
      ss = a[i+1]
      if ss-s ==1 then( 
        append cc   s 
        print i
    )else (
        append cc   s 
        exit
    ) 
)
cc

 

posted on 2013-07-08 18:22  盖天00  阅读(221)  评论(0编辑  收藏  举报

导航