views:

1602

answers:

2

Just moved over to the VB team here at work.

Quick easy one for my 1st question.

What is the equivalent keyword to break in VB, i.e., to exit a loop early but not the method?

Cheers!

+24  A: 

In both VB6 and VB.Net you would use:

Exit For

or

Exit While

or

Exit Do

... depending on the loop type.

John
Also on a related note, "Continue" will allow you to skip to the next iteration in a for loop.
StingyJack
+1  A: 

Exit [construct], and intelisense will tell you which one(s) are valid in a particular place.

Eric Haskins