title: VB.NET Switch Statement GoTo Case
body: <p>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:</p>
  
  <pre><code>switch (parameter)
  {
      case "userID":
          // does something here.
      case "packageID":
          // does something here.
      case "mvrType":
          if (otherFactor)
          {
              // does something here.
          }
          else
          {
              goto default;
          }
      default:
          // does some processing...
          break;
  }
  </code></pre>
  
  <p>However, I don't know how to convert this to VB.NET. I tried this:</p>
  
  <pre><code>Select Case parameter 
      Case "userID"
          ' does something here.
      Case "packageID"
          ' does something here.
      Case "mvrType" 
          If otherFactor Then 
              ' does something here. 
          Else 
              GoTo Case Else 
          End If 
      Case Else 
          ' does some processing... 
          Exit Select 
  End Select     
  </code></pre>
  
  <p>But when I do this I get a compiler error: "Identifier expected". There'sa squiggly line under "Case". Any ideas? </p>
  
  <p>Also, is it wrong to use a GoTo statement in this case? It seems any other way I would have to re-write it.</p>
  
  <hr>
  
  <p>I have changed my code to as follows:</p>
  
  <pre><code>If otherFactor AndAlso parameter = "mvrType" Then 
      'does something here 
  Else 
      ' My original "Select Case statement" here without the case for "mvrType" 
  End If
  </code></pre>