Exit case is not a Basic statement. In C and related dialects you need to Exit since every subsequent statement will be executed also if it"s not the case...
In Basic every single case is tested.
With VB.Net you can exit from a single case, using Exit Select:
B4X:
Dim a As Integer = 3
Dim b As Integer = 30
Select Case a
Case 3
Debug.WriteLine("Executed before exit")
If b = 30 Then
Exit Select
End If
Debug.WriteLine("Executed after exit") ' <--- this line will not be executed
End Select
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.