for i=1 to 10
      ----
        if i=5 then 
            exit for
          ----
        end if
    next 

解决方案 »

  1.   

    if i=5 then Exit For
      

  2.   

    可以試一下在里面用Select 語句呀
     For i = 1 To 10
      Select Case i
        Case Is < 5
          ' Add Code You Want to Do
        Case Is > 5
          ' Add Code You Want to Do
      End Select
    Next
      

  3.   

    不要 GOTO ,不要 IF THEN ,那 SELECT 如何? 和IF 是一样的还不行,那换语言吧楼主!
      

  4.   

    Goto还是不要用了吧。这样不很好吗
    哦你的意思肯定不要是退出,而且当等于5时跳过去
    那就是
    for i=1 to 10……(语句)
    if i=4 then i=i+1
    next i
      

  5.   

    exit for 晕呀
    我要的是跳出本次循环,不是整个循环。
      

  6.   

    lightwiter1的做法不错
    up up
      

  7.   

    呵呵,可以这样:Private Sub Command1_Click()
    Dim temp As String
    temp = ""
    For I = 1 To 10
    If I <> 5 Then temp = temp & " " & I
    Next
    MsgBox temp
    End Sub
      

  8.   

    lightwiter1(lightwiter) 你的做法是可以。
    还有用goto也可以。
    没有什么函数和命令吗?
    就象C里的continue结束本次循环,back结束整个循环。
      

  9.   

    exit for;exit do不都可以的吗?
      

  10.   

    如果不想用goto,if,select,那我好象在VB里还没遇到过!
      

  11.   

    i=1
    do while i<=10
       if i=5 then i=i+1
       ...
       i=i+1
    loop
      

  12.   

    我算是看明白了要问的什么了
    可以这样子了(我以前用QB时老这样)
    for i = 1 to k
        ....
        if i= 5 then next i
        ....
    next i但为什么不用Goto呢?这个命令可是Basic的精品哟,我很喜欢她的!!!
      

  13.   

    是不是VB没有像C的continue一样功能的的函数或命令。
    那只有用goto了。唉……。
      

  14.   

    continue好象是没有,我也有你类似的问题,只好判断一下了