ASP如何跳出本次进入下一次循环

时间:2007-03-19 13:00:59  来源:  作者:
看下面的Java代码,目的是为了当i是3的时候,就不做输出,直接跳到下一个循环。

        int i = 0; aZm第一天空网络
        while (i < 5) ...{aZm第一天空网络
            i++;aZm第一天空网络
            if (i == 3) ...{aZm第一天空网络
                continue;aZm第一天空网络
            }aZm第一天空网络
            System.out.println("I'm not 3, I'm " + i);aZm第一天空网络
            // Do something else...aZm第一天空网络
        }aZm第一天空网络
 然而在ASP (VB) 应该怎么写呢?不少人就犯难了。在此,我给出些答案供参考,还往多多指教!aZm第一天空网络

    i = 0aZm第一天空网络
    Do While (i < 5)aZm第一天空网络
        If (i <> 3) ThenaZm第一天空网络
            'MsgBox "I'm not 3, I'm " & iaZm第一天空网络
            'Do something else...aZm第一天空网络

        End IfaZm第一天空网络
        i = i + 1aZm第一天空网络
    LoopaZm第一天空网络
 显然,上面的例子会贻笑大方。 aZm第一天空网络

    i = 0aZm第一天空网络
    Do While (i < 5)aZm第一天空网络
        For j = 1 To 1aZm第一天空网络
            If (i = 3) ThenaZm第一天空网络
                Exit ForaZm第一天空网络
            End IfaZm第一天空网络
            'MsgBox "I'm not 3, I'm " & iaZm第一天空网络
            'Do something else...aZm第一天空网络
            aZm第一天空网络
        Next jaZm第一天空网络
        i = i + 1aZm第一天空网络
    LoopaZm第一天空网络

http://blog.csdn.net/chyzan/archive/2007/03/15/1530645.aspxaZm第一天空网络

文章评论

共有 位天空网友发表了评论 查看完整内容

特别推荐
  • 文字广告
  • 文字广告
  • 文字广告
  • 文字广告
站长黑板报

24小时热门信息