this took me a while time to find via MSDN Library or Google. That’s because I didn’t notice it at the bottom of the “switch” explanation on C# (duh!). (And because the fantabulous C# & VB.NET Conversion Pocket Ref doesn’t have an index and I couldn’t find the listing for this in the TOC.) It’s hard when you don’t really know what you are looking for! That is my driving reason for doing the C# for VB programmers talk (at Code Camp this weekend and at DevConnections in a few weeks)
VB lets you put optional cases together as in
3 Or 4 3,4 ‘(duh, I guess I should have gone and looked at one of my many examples of this in my real applications!)
‘do something if it’s 3 or 4
C# does it this way
//do something if it’s 3 or 4
This seems to be referred to as “stacked case labels”.
Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!