ASP跳出本次循环进入下一循环的方法:因果循环的说说

看下面的Java代码,目的是为了当i是3的时候,就不做输出,直接跳到下一个循环。

int i = 0;

while (i < 5) ...{

i++;

if (i == 3) ...{

continue;

}

System.out.println("I"m not 3, I"m " + i);

// Do something else...

}

然而在ASP (VB) 应该怎么写呢?不少人就犯难了。在此,我给出些答案供参考,还往多多指教!

i = 0

Do While (i < 5)

If (i <> 3) Then

"MsgBox "I"m not 3, I"m " & i

"Do something else...

End If

i = i + 1

Loop

显然,上面的例子会贻笑大方。

i = 0

Do While (i < 5)

For j = 1 To 1

If (i = 3) Then

Exit For

End If

"MsgBox "I"m not 3, I"m " & i

"Do something else...

Next j

i = i + 1

Loop