Author Topic: BREAK/CONTINUE does not work inside REPEAT/UNTIL  (Read 1920 times)

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1600
    • View Profile
    • AMpostata Website
The compiler gives an error

error : BREAK outside of FOR/WHILE

if the BREAK/CONTINUE is inside a REPEAT/UNTIL loop
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1790
    • View Profile
    • Homepage
The manual says break is only used in FOR and WHILE loops. So not a bug but mabe a feature request? :-)

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1600
    • View Profile
    • AMpostata Website
LOL, you name it  ;)
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Offline Scott_AW

  • Mr. Polyvector
  • ***
  • Posts: 214
    • View Profile
    • SAW Game Design
Isn't repeat fairly new?

I remember when I went to 8 I had to rename a goto.

On the plus side I was happy to see a UNTIL loop.
Current Project, Orbital Contract Defense
http://gamejolt.com/games/adventure/code-name-ocd/9887/

BlackShadow now open source/resource(requires duke3d)
http://gamejolt.com/games/adventure/black-shadow-3d/9885/

MrTAToad

  • Guest
Yes, REPEAT/UNTIL is fairly new.

Technically, using BREAK inside a REPEAT/UNTIL loop is poor form really (using it in WHILE could also be regarded as the same), as you should be using the condition to break out of the loop.

Offline Scott_AW

  • Mr. Polyvector
  • ***
  • Posts: 214
    • View Profile
    • SAW Game Design
Have you tried using CONTINUE and triggering the UNTIL?

What do you have going on in the loop?
Current Project, Orbital Contract Defense
http://gamejolt.com/games/adventure/code-name-ocd/9887/

BlackShadow now open source/resource(requires duke3d)
http://gamejolt.com/games/adventure/black-shadow-3d/9885/