Mega Code Archive

 
Categories / VB.Net Tutorial / Statements
 

Use both range and fix value in Select statement

Module Module1     Sub Main()         Dim intInput As Integer = 12                  Select Case intInput             Case 1                 Console.WriteLine("Thank you for the 1.")             Case 2 To 5                 Console.WriteLine("Your value was 2, 3, 4, or 5")             Case Is > 5                 Console.WriteLine("That was greater than 5.")             Case Else                 Console.WriteLine("Sorry, I can't deal with that.")         End Select     End Sub End Module That was greater than 5.