Android Question Does SELECT CASE needs the EXIT statement?

sorex

Expert
Licensed User
Longtime User
it already implements a break. some languages (PHP for example) require that you set it yourself tho.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
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
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…