BREAK/CONTINUE does not work inside REPEAT/UNTIL

Previous topic - Next topic

ampos

The compiler gives an error

error : BREAK outside of FOR/WHILE

if the BREAK/CONTINUE is inside a REPEAT/UNTIL loop

Moru

The manual says break is only used in FOR and WHILE loops. So not a bug but mabe a feature request? :-)

ampos


Scott_AW

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

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.

Scott_AW

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/