VB.NET Switch Statement GoTo Case

前端 未结 9 993
你的背包
你的背包 2020-12-10 23:42

I am writing some code in VB.NET that uses a switch statement but in one of the cases it needs to jump to another block. In C# it would look like this:

switc         


        
9条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-11 00:22

    Select Case parameter 
        ' does something here. 
        ' does something here. 
        Case "userID", "packageID", "mvrType" 
            If otherFactor Then 
                ' does something here. 
            Else 
                goto case default 
            End If 
        Case Else 
            ' does some processing... 
            Exit Select 
    End Select
    

提交回复
热议问题