View Single Post
Old 11-28-2005, 07:19 AM   #7 (permalink)
TheHeadFL
 
Ultra Techie

Join Date: Jul 2005

Posts: 530

TheHeadFL

Send a message via AIM to TheHeadFL
Default

I feel I need to clarify my statement.

For example...

Code:
for (something)
   {
   for (something)
   {
      for (even something else yet)
      {
         if (condition) {
         // Get out of all the loops
         }
      }
   }
}
This is extremely convoluted and painful to do with a break statement. In order to do it this way, you need to cascade several levels of breaks. In other words, outside every loop, you check to see if the loop prematurely exited, and if it did, you break out.

You can be married to the "no gotos" style, or you can just save yourself the hassle, confusion, and obtuse style of the cascading break method and just deign to use a goto.
__________________
Desktop machine: 2 x Opteron 246, Asus K8N-DL, 2GB PC3200 ECC Reg., XFX GeForce 6600GT, 74gb WD Raptor, 2 x 19\" LCDs, Windows XP x64
Server machine: Intel P4 3.0GHz 2MB EM64T, ECS i865pe, 1GB PC3200, 36gb WD Raptor, Windows Server 2003
Laptop: Dell Inspiron 9100 (Intel P4 3.2GHz 1MB Prescott, i865pe, 512MB PC3200, Mobility Radeon 9700, DVD+R/DL Burner), Windows XP
Linux: P3 450Mhz, 386MB ram, Slackware 10.1 (Running mySQL/Apache)
TheHeadFL is offline