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. The Lounge
  3. Today, I used goto to double-break out of nested loops

Today, I used goto to double-break out of nested loops

Scheduled Pinned Locked Moved The Lounge
csharpc++phpcomquestion
35 Posts 26 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.
  • P peterchen

    "and I feel fine!" (to say it with R.E.M.)

    Agh! Reality! My Archnemesis![^]
    | FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy

    S Offline
    S Offline
    S Becker
    wrote on last edited by
    #4

    Maybe you should use: break;break; :-D

    Regards Sascha

    P 1 Reply Last reply
    0
    • P peterchen

      "and I feel fine!" (to say it with R.E.M.)

      Agh! Reality! My Archnemesis![^]
      | FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #5

      It's the end of the loop as we know it.

      I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Onyx

      1 Reply Last reply
      0
      • S S Becker

        Maybe you should use: break;break; :-D

        Regards Sascha

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #6

        You've heard me in the car with Mrs Yoda then. All though you're missing the "For God's sake Brake." from the end.

        I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

        Forgive your enemies - it messes with their heads

        My blog | My articles | MoXAML PowerToys | Onyx

        N L 2 Replies Last reply
        0
        • P peterchen

          "and I feel fine!" (to say it with R.E.M.)

          Agh! Reality! My Archnemesis![^]
          | FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #7

          Somewhere, God killed a kitten, AND IT'S ALL YOUR FAULT! ;)

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak

          J P 2 Replies Last reply
          0
          • P peterchen

            "and I feel fine!" (to say it with R.E.M.)

            Agh! Reality! My Archnemesis![^]
            | FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy

            N Offline
            N Offline
            Nemanja Trifunovic
            wrote on last edited by
            #8

            I guess I'd move the nested loops into a separate function and called return instead, but that's really goto in disguise anyway :)

            utf8-cpp

            OriginalGriffO T D 3 Replies Last reply
            0
            • P Pete OHanlon

              You've heard me in the car with Mrs Yoda then. All though you're missing the "For God's sake Brake." from the end.

              I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

              Forgive your enemies - it messes with their heads

              My blog | My articles | MoXAML PowerToys | Onyx

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

              So you're not Shiney Happy People then?


              Panic, Chaos, Destruction. My work here is done. or "Drink. Get drunk. Fall over." - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre

              1 Reply Last reply
              0
              • P Pete OHanlon

                You've heard me in the car with Mrs Yoda then. All though you're missing the "For God's sake Brake." from the end.

                I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

                Forgive your enemies - it messes with their heads

                My blog | My articles | MoXAML PowerToys | Onyx

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #10

                This is why I only let my wife drive when I am drunk. My dad really lucked out, my mum is both teetotal and a non-driver.

                Every man can tell how many goats or sheep he possesses, but not how many friends.

                1 Reply Last reply
                0
                • D Dalek Dave

                  I am not the only one then! :)

                  ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC League Table Link CCC Link[^]

                  S Offline
                  S Offline
                  Slacker007
                  wrote on last edited by
                  #11

                  Dalek Dave wrote:

                  I am not the only one then!

                  yes you are. :-D

                  1 Reply Last reply
                  0
                  • D Dalek Dave

                    I am not the only one then! :)

                    ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC League Table Link CCC Link[^]

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

                    He said "break" not "goto"... :)

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

                    1 Reply Last reply
                    0
                    • D Dave Kreskowiak

                      Somewhere, God killed a kitten, AND IT'S ALL YOUR FAULT! ;)

                      A guide to posting questions on CodeProject[^]
                      Dave Kreskowiak

                      J Offline
                      J Offline
                      J4amieC
                      wrote on last edited by
                      #13

                      Oh god, dont talk about killing Cats, have you not seen the hoo-har in the last 24hrs.

                      F D D 3 Replies Last reply
                      0
                      • N Nemanja Trifunovic

                        I guess I'd move the nested loops into a separate function and called return instead, but that's really goto in disguise anyway :)

                        utf8-cpp

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

                        There are those who think a function should have a single return - I'm not one of them. I would probably do it your way - it's clearer than the "brain bounce" I get when I see goto in OO code.

                        Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

                        "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

                        1 Reply Last reply
                        0
                        • P peterchen

                          "and I feel fine!" (to say it with R.E.M.)

                          Agh! Reality! My Archnemesis![^]
                          | FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy

                          M Offline
                          M Offline
                          Mike Hankey
                          wrote on last edited by
                          #15

                          ooo sorry there will be a serious reduction of man-points and you may be reduced to writing VB code in the near future.

                          Artificial Intelligence is no match for Natural Stupidity. http://www.hq4thmarinescomm.com[^] My Site

                          P 1 Reply Last reply
                          0
                          • J J4amieC

                            Oh god, dont talk about killing Cats, have you not seen the hoo-har in the last 24hrs.

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

                            mmm, Kitten Stew. On second thought... X|

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

                            1 Reply Last reply
                            0
                            • J J4amieC

                              Oh god, dont talk about killing Cats, have you not seen the hoo-har in the last 24hrs.

                              D Offline
                              D Offline
                              Dan Neely
                              wrote on last edited by
                              #17

                              Not until after the fact. Kinda annoying since it leaves me wondering if someone really freaked over the parody of the old Harry Chapin song; or if there's better trolling material out there...

                              3x12=36 2x12=24 1x12=12 0x12=18

                              1 Reply Last reply
                              0
                              • D Dave Kreskowiak

                                Somewhere, God killed a kitten, AND IT'S ALL YOUR FAULT! ;)

                                A guide to posting questions on CodeProject[^]
                                Dave Kreskowiak

                                P Offline
                                P Offline
                                peterchen
                                wrote on last edited by
                                #18

                                She had terminal cancer, and that's HIS fault.

                                Agh! Reality! My Archnemesis![^]
                                | FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy

                                1 Reply Last reply
                                0
                                • J J4amieC

                                  Oh god, dont talk about killing Cats, have you not seen the hoo-har in the last 24hrs.

                                  D Offline
                                  D Offline
                                  Dave Kreskowiak
                                  wrote on last edited by
                                  #19

                                  No. Have I missed soemthing?

                                  A guide to posting questions on CodeProject[^]
                                  Dave Kreskowiak

                                  D 1 Reply Last reply
                                  0
                                  • J Jim Crafton

                                    You're a dirty little pervert! Somewhere Edsger Dijkstra's is choking on a Raise Error statement!

                                    ¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow

                                    P Offline
                                    P Offline
                                    peterchen
                                    wrote on last edited by
                                    #20

                                    It's the only action he'll get tonight.

                                    Agh! Reality! My Archnemesis![^]
                                    | FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy

                                    1 Reply Last reply
                                    0
                                    • D Dave Kreskowiak

                                      No. Have I missed soemthing?

                                      A guide to posting questions on CodeProject[^]
                                      Dave Kreskowiak

                                      D Offline
                                      D Offline
                                      Dan Neely
                                      wrote on last edited by
                                      #21

                                      Read the thread titled disgusting in bugs/suggestions. That'll let you see everything except the actual post that triggered the flamewar.

                                      3x12=36 2x12=24 1x12=12 0x12=18

                                      1 Reply Last reply
                                      0
                                      • M Mike Hankey

                                        ooo sorry there will be a serious reduction of man-points and you may be reduced to writing VB code in the near future.

                                        Artificial Intelligence is no match for Natural Stupidity. http://www.hq4thmarinescomm.com[^] My Site

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

                                        Mike Hankey wrote:

                                        reduced to writing VB

                                        Oh shiioot... is that what happened? But I swear it was in a switch! :sigh:

                                        M 1 Reply Last reply
                                        0
                                        • N Nemanja Trifunovic

                                          I guess I'd move the nested loops into a separate function and called return instead, but that's really goto in disguise anyway :)

                                          utf8-cpp

                                          T Offline
                                          T Offline
                                          Tom Chantler
                                          wrote on last edited by
                                          #23

                                          That's what I'd have done too. You're allowed to do stuff like that! :)

                                          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