开发者

VB.Net's For Next

Is there a difference between the开发者_开发百科se?

For i = 0 To Something.Length - 1
  'do something
Next

For i = 0 To Something.Length - 1
  'do something
Next i


It is only for readability:

You can optionally specify counter in the Next statement. This improves the readability of your program, especially if you have nested For loops. You must specify the same variable as the one that appears in the corresponding For statement.

From http://msdn.microsoft.com/en-us/library/5z06z1kb.aspx


Nope. There is no difference. Even with nested loops there is no difference because nested for-loops cannot overlap.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜