break does not break out of an if statement, so from the code snippet you
posted, it has no actual context. break in C# breaks out of a loop construct or
a switch statement. For a switch statement (Select Case in VB) you don't need
the break statement in VB, it is assumed. For loop constructs, break would be
the equivalent of Exit Do, Exit For or Exit While.
LOL ! There is no such thing, and given that VB's Select Case does not have
fall through there is no need to in a select Case statement.
(Note: C# does not have fall through in a switch statement either, but still
requires the break statement in a switch block due to some weird consistency
with Java or other C style languages that do have fall through)
John Smith said:
use
Exit Select
Brian said:
How would you convert a scope break statement to vb?
ROFL ! Just to be clear though, that is not needed in Vb.NET as per the usual
use of C#'s break in a switch statement. It would be only when C# used multiple
break statements inside a case block. The Exit Select would be the equivalent of
the break statements except the last break statement per case block in a switch
block.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.