Posts VB.NET Wish


Here's an example.

For i = 1 To 100
  If i > 5 AndAlso i < 20 Then
    ' Skip over the rest of the processing inside of the loop
    ' and start the next iteration. 
    Continue For '<----- I want this added.
  End If
  ' Do some process.

C# and C++ have this. I didn't know how useful it was until going through a ton of conversions from C# to VB.NET. It's handy and it wouldn't break any of the language rules that are in place. You could have Continue For, Continue Do, and Continue While. Saves you from having to do nested if/then statements or far worse... using goto statements :-(

This post is licensed under CC BY 4.0 by the author.