Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Is this the case to select case?

Is this the case to select case?

Scheduled Pinned Locked Moved The Weird and The Wonderful
question
12 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alberto Biasiutti
    wrote on last edited by
    #1

    Here's a little jewel I found in the source code of a module I bought (just changed querystring parameter and variable names)

    If Request.QueryString("queryParam") <> Nothing Then
    Select Case Convert.ToInt16(Request.QueryString("queryParam"))
    Case 1
    var = 1
    Case 2
    var = 2
    Case 3
    var = 3
    Case 4
    var = 4

        Case 5
            var = 5
        Case 6
            var = 6
    End Select
    

    Else

    Hopefully the possible values of the parameter won't grow in future :)

    R B V 3 Replies Last reply
    0
    • A Alberto Biasiutti

      Here's a little jewel I found in the source code of a module I bought (just changed querystring parameter and variable names)

      If Request.QueryString("queryParam") <> Nothing Then
      Select Case Convert.ToInt16(Request.QueryString("queryParam"))
      Case 1
      var = 1
      Case 2
      var = 2
      Case 3
      var = 3
      Case 4
      var = 4

          Case 5
              var = 5
          Case 6
              var = 6
      End Select
      

      Else

      Hopefully the possible values of the parameter won't grow in future :)

      R Offline
      R Offline
      RCoate
      wrote on last edited by
      #2

      That's terrible. Where's the default value? :-D

      A 1 Reply Last reply
      0
      • R RCoate

        That's terrible. Where's the default value? :-D

        A Offline
        A Offline
        Alberto Biasiutti
        wrote on last edited by
        #3

        No, this is not terrible, it's good... it made me laugh!! :)

        1 Reply Last reply
        0
        • A Alberto Biasiutti

          Here's a little jewel I found in the source code of a module I bought (just changed querystring parameter and variable names)

          If Request.QueryString("queryParam") <> Nothing Then
          Select Case Convert.ToInt16(Request.QueryString("queryParam"))
          Case 1
          var = 1
          Case 2
          var = 2
          Case 3
          var = 3
          Case 4
          var = 4

              Case 5
                  var = 5
              Case 6
                  var = 6
          End Select
          

          Else

          Hopefully the possible values of the parameter won't grow in future :)

          B Offline
          B Offline
          BotCar
          wrote on last edited by
          #4

          I saw something similar at Computer Stupidities (about halfway down the page). This is worse, though, because one wouldn't expect such atrocities from professionals.

          A 1 Reply Last reply
          0
          • A Alberto Biasiutti

            Here's a little jewel I found in the source code of a module I bought (just changed querystring parameter and variable names)

            If Request.QueryString("queryParam") <> Nothing Then
            Select Case Convert.ToInt16(Request.QueryString("queryParam"))
            Case 1
            var = 1
            Case 2
            var = 2
            Case 3
            var = 3
            Case 4
            var = 4

                Case 5
                    var = 5
                Case 6
                    var = 6
            End Select
            

            Else

            Hopefully the possible values of the parameter won't grow in future :)

            V Offline
            V Offline
            V 0
            wrote on last edited by
            #5

            It's VB, what'd you expect? :-D

            V.

            A 1 Reply Last reply
            0
            • B BotCar

              I saw something similar at Computer Stupidities (about halfway down the page). This is worse, though, because one wouldn't expect such atrocities from professionals.

              A Offline
              A Offline
              Alberto Biasiutti
              wrote on last edited by
              #6

              I'm consider myself far from being a gur at programming, but those things make me cry.. I still have to understand if it's sadness or joy!! :D Thank's for the link

              1 Reply Last reply
              0
              • V V 0

                It's VB, what'd you expect? :-D

                V.

                A Offline
                A Offline
                Alberto Biasiutti
                wrote on last edited by
                #7

                I might offend, I'm also a vb guy!! :D At least, a I try to be as [C]sharp minded as possible :)

                V N 2 Replies Last reply
                0
                • A Alberto Biasiutti

                  I might offend, I'm also a vb guy!! :D At least, a I try to be as [C]sharp minded as possible :)

                  V Offline
                  V Offline
                  V 0
                  wrote on last edited by
                  #8

                  Alberto Biasiutti wrote:

                  I'm also a vb guy

                  Maybe you don't have a choice, in that case you're forgiven as long as you keep that C# minded brain working :-D

                  V.

                  1 Reply Last reply
                  0
                  • A Alberto Biasiutti

                    I might offend, I'm also a vb guy!! :D At least, a I try to be as [C]sharp minded as possible :)

                    N Offline
                    N Offline
                    Nagy Vilmos
                    wrote on last edited by
                    #9

                    Alberto Biasiutti wrote:

                    I'm also a vb guy!!

                    We'll. Speak. Slowly. Then. :laugh: I worked in VB for about 15 years and I am pleased to have escaped. For now.


                    Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

                    A OriginalGriffO 2 Replies Last reply
                    0
                    • N Nagy Vilmos

                      Alberto Biasiutti wrote:

                      I'm also a vb guy!!

                      We'll. Speak. Slowly. Then. :laugh: I worked in VB for about 15 years and I am pleased to have escaped. For now.


                      Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

                      A Offline
                      A Offline
                      Alberto Biasiutti
                      wrote on last edited by
                      #10

                      Every time I come to CP, I feel dirty because I use VB! I'll denounce you for discrimination!

                      1 Reply Last reply
                      0
                      • N Nagy Vilmos

                        Alberto Biasiutti wrote:

                        I'm also a vb guy!!

                        We'll. Speak. Slowly. Then. :laugh: I worked in VB for about 15 years and I am pleased to have escaped. For now.


                        Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

                        OriginalGriffO Offline
                        OriginalGriffO Offline
                        OriginalGriff
                        wrote on last edited by
                        #11

                        Nagy Vilmos wrote:

                        I worked in VB for about 15 years

                        That explains the lunchtime drinking... :laugh:

                        Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

                        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                        N 1 Reply Last reply
                        0
                        • OriginalGriffO OriginalGriff

                          Nagy Vilmos wrote:

                          I worked in VB for about 15 years

                          That explains the lunchtime drinking... :laugh:

                          Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

                          N Offline
                          N Offline
                          Nagy Vilmos
                          wrote on last edited by
                          #12

                          OriginalGriff wrote:

                          That explains the lunchtime drinking.

                          No, that was the early part of career working in COBOL. VB is responsible for the night time drinking. :-D


                          Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups