XDotNetXDotNet

My feedback

  1. 76 votes
    Vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      You have left! (?) (thinking…)
      12 comments  ·  Visual Studio IDE » Languages - Visual Basic  ·  Flag idea as inappropriate…  ·  Admin →

      Hey everyone,

      If you hadn’t heard already last week at BUILD we announced the PUBLIC release of a Preview of the next version of the Visual Basic language and code editing experience powered by “Roslyn”. You can download this preview and install it on top of Visual Studio 2013 today!

      I’m excited to let you know that included in this is a preview of a new language feature we’re considering that let’s you Select Case on the type of an object like this:

      Select Case obj
      Case b As Button

      Case t As TextBox

      End Case

      You can read about it more here: http://www.codeplex.com/Download?ProjectName=roslyn&DownloadId=824695

      Download the End User Preview @ http://msdn.microsoft.com/en-US/vstudio/roslyn

      I encourage you all to download it, try it out, and send us your feedback.

      Regards,

      Anthony D. Green, Program Manager, Visual Basic & C# Languages Team

      XDotNetXDotNet supported this idea  · 
      XDotNetXDotNet commented  · 

      Add linq/lambda as well

      Select case From c as customer in myList(of Customer) where c.contains("Marsha").First
      Case "Greg"
      Case "Marsha"
      Case "Peter"
      End Select

      The possibilities are limitless especially you allow "Case" to have some logic.

      Select case From c as customer in myList(of object) select c
      Case is typeOf Dictionary(of string,string)
      Case is typeOf ListOf(String)
      Case is typeOf Dictionary(of Date, String)
      End Select

    • 47 votes
      Vote
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        I agree to the terms of service
        Signed in as (Sign out)
        You have left! (?) (thinking…)
        9 comments  ·  Visual Studio IDE » Languages - Visual Basic  ·  Flag idea as inappropriate…  ·  Admin →

        Hey Robert,

        Great suggestion. As you’ve noted in all of your suggestions there’s a lot more potential with the Select Case statement that we don’t yet support. Reference equality comparisons (Is/IsNot) and the Like operator are great examples as is type-checking. We’re actively thinking about improving the Select Case statement for these scenarios.

        Your suggestion is actually the most likely syntax we would use if we were to implement this feature and it seems more like a bug that it doesn’t just work. That said is the Like operator still useful to you compared to say RegEx – which is more powerful?

        -Anthony D. Green, Program Manager, Visual Basic & C# Languages Team

        XDotNetXDotNet supported this idea  · 
        XDotNetXDotNet commented  · 

        Add linq/lambda too

        Select Case = From c as customer in myList(of Customer) where....
        Case "Greg"
        Case "Marsha"
        end select

      Feedback and Knowledge Base