Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB.NET - Alternative to "Continue For" for Visual Studio 2003

I'm trying to skip to the next entry in a for loop.

For Each i As Item In Items
    If i = x Then
        Continue For
    End If

    ' Do something
Next

In Visual Studio 2008, I can use "Continue For". But in VS Visual Studio 2003, this doesn't exist. Is there an alternative method I could use?

like image 768
Urbycoz Avatar asked Mar 03 '26 11:03

Urbycoz


1 Answers

Well you could simply do nothing if your condition is true.

For Each i As Item in Items
    If i <> x Then ' If this is FALSE I want it to continue the for loop
         ' Do what I want where
    'Else
        ' Do nothing
    End If
Next
like image 79
Smur Avatar answered Mar 05 '26 04:03

Smur