I have code that is similar to below. I am wanting to exit from the B loop to the top of the A loop skipping all the other code below the B loop. Is it possible to exit from B somehow to the top of A?
for a as integer = 0 to RowCount
If this = that Then
Blah
Else
Blah
End If
for b as integer = 0 to RowCount
BLAH
Else
//EXIT TO A HERE
Exit
End If
next b
//Several If statements after testing different things
If BLAH Then
Blah
End If
next a
I looked through that but both Exit and Continue only leave B and continue to the next if below B. Is there a way to specify which loop to continue to?
Which you use (Continue For A or Exit For B) depends on whether you want any statements after the For B loop to run. The Continue statement will stop and send you back to the top immediately whereas the Exit statement just drops you out of the loop and continues with the code after the inner loop.