Android Question Does SELECT CASE needs the EXIT statement?

wonder

Expert
Licensed User
Longtime User
Which one is correct?
B4X:
'Example A:
Dim n = 0 As Int
Select n
    Case 0
        n = 1
        Exit
      
    Case 1
        n = 100
        Exit

End Select
or
B4X:
'Example B:
Dim n = 0 As Int
Select n
    Case 0
        n = 1      
      
    Case 1
        n = 100      

End Select
 

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
Top