Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Requests and Feedback

break statement

A community discussion post from the original code:zIRON forum.

Replies

efgee member
Posts
1
Threads
0
Location
Unknown

IMHO aliases are better than numbers...

  repeat this_one// outer loop
   {

     case that_one (..)
      {
        state .....:
              break;  // break the case block

        state .....:
               break this_one;  // break the repeat block 
      }
   };

When code size increases you will appreciate meaningful aliases over silent numbers.

Colin admin
Posts
928
Threads
49
Location
Bulgaria

sorry i don't quite understand what you mean...can you explain?

Colin admin
Posts
928
Threads
49
Location
Bulgaria

aha nm i think i see now (tired going to bed lol)

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

efgee:

you can implement it even if break will support only number , consider the next code.

 const  this_one = 1;
  
  repeat // outer loop
   {

     case(..)
      {
        state .....:
              break;  // break the case block

        state .....:
               break 1;  // break the repeat block and so on break 2 ....etc
      }
   };
  

http://www.freewebs.com/ogremagic/index.htm

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

sorry this is the correct code

const  this_one = 1;
  
  repeat // outer loop
   {

     case(..)
      {
        state .....:
              break;  // break the case block

        state .....:
               break this_one;  // break the repeat block and so on break 2 ....etc
      }
   };
  

http://www.freewebs.com/ogremagic/index.htm