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. At least this one was easy to refactor...

At least this one was easy to refactor...

Scheduled Pinned Locked Moved The Weird and The Wonderful
code-review
7 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.
  • R Offline
    R Offline
    Rob Grainger
    wrote on last edited by
    #1

    I'm no fan of goto at the best of times, but at least this one disappeared quickly:

        If Not rsTest.EOF Then
            rsTest.MoveLast
         
            If Format(rsTest!OKDATE, "yyyy/mm/dd") > Format(cutOffDate, "yyyy/mm/dd") Then
                dataStat = "2"
                GoTo UpdAccount
            End If
        End If
    

    UpdAccount:

    I kid you not!

    F I E 3 Replies Last reply
    0
    • R Rob Grainger

      I'm no fan of goto at the best of times, but at least this one disappeared quickly:

          If Not rsTest.EOF Then
              rsTest.MoveLast
           
              If Format(rsTest!OKDATE, "yyyy/mm/dd") > Format(cutOffDate, "yyyy/mm/dd") Then
                  dataStat = "2"
                  GoTo UpdAccount
              End If
          End If
      

      UpdAccount:

      I kid you not!

      F Offline
      F Offline
      fjdiewornncalwe
      wrote on last edited by
      #2

      I'm not quite sure if the GoTo is the horror, or that I just read a block of VB.... Dirty... I feel dirty...

      I wasn't, now I am, then I won't be anymore.

      R M 2 Replies Last reply
      0
      • F fjdiewornncalwe

        I'm not quite sure if the GoTo is the horror, or that I just read a block of VB.... Dirty... I feel dirty...

        I wasn't, now I am, then I won't be anymore.

        R Offline
        R Offline
        Rob Grainger
        wrote on last edited by
        #3

        It's slightly worse than that, this is VBA.

        1 Reply Last reply
        0
        • F fjdiewornncalwe

          I'm not quite sure if the GoTo is the horror, or that I just read a block of VB.... Dirty... I feel dirty...

          I wasn't, now I am, then I won't be anymore.

          M Offline
          M Offline
          musefan
          wrote on last edited by
          #4

          My thoughts exactly X|

          return 5;

          1 Reply Last reply
          0
          • R Rob Grainger

            I'm no fan of goto at the best of times, but at least this one disappeared quickly:

                If Not rsTest.EOF Then
                    rsTest.MoveLast
                 
                    If Format(rsTest!OKDATE, "yyyy/mm/dd") > Format(cutOffDate, "yyyy/mm/dd") Then
                        dataStat = "2"
                        GoTo UpdAccount
                    End If
                End If
            

            UpdAccount:

            I kid you not!

            I Offline
            I Offline
            imagiro
            wrote on last edited by
            #5

            Well, the GoTo is important here, otherwise the computer may not know what to do: Sit down and have a coffee, travel to Egypt and visit the pyramides or maybe format the harddisks.. I always suggested to put a GoToNextStatement after each statement. But these dumb guys from microsoft didn't want to listen to me..

            P 1 Reply Last reply
            0
            • I imagiro

              Well, the GoTo is important here, otherwise the computer may not know what to do: Sit down and have a coffee, travel to Egypt and visit the pyramides or maybe format the harddisks.. I always suggested to put a GoToNextStatement after each statement. But these dumb guys from microsoft didn't want to listen to me..

              P Offline
              P Offline
              PIEBALDconsult
              wrote on last edited by
              #6

              Yeah, if only we could maybe assign a numerical order to the statements... :rolleyes:

              1 Reply Last reply
              0
              • R Rob Grainger

                I'm no fan of goto at the best of times, but at least this one disappeared quickly:

                    If Not rsTest.EOF Then
                        rsTest.MoveLast
                     
                        If Format(rsTest!OKDATE, "yyyy/mm/dd") > Format(cutOffDate, "yyyy/mm/dd") Then
                            dataStat = "2"
                            GoTo UpdAccount
                        End If
                    End If
                

                UpdAccount:

                I kid you not!

                E Offline
                E Offline
                Euhemerus
                wrote on last edited by
                #7

                What I find deeply disturbing by this and other examples of bad coding is that these people get paid for writing this rubbish. Furthermore, what is more frightening is the fact that they could be writing code for safety systems or banking systems or who knows what else. No bloody wonder the software industry puts a NO WARRANTIES EXPRESSED OR IMPLIED notice into every EULA D'Oh! They're not even sure it's going to work. Can you imagine buying a new car and the manufacturer said that there were no warranties?

                Nobody can get the truth out of me because even I don't know what it is. I keep myself in a constant state of utter confusion. - Col. Flagg

                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