GLBasic forum

Main forum => Bug Reports => Topic started by: ampos on 2010-Oct-15

Title: BREAK/CONTINUE does not work inside REPEAT/UNTIL
Post by: ampos on 2010-Oct-15
The compiler gives an error

error : BREAK outside of FOR/WHILE

if the BREAK/CONTINUE is inside a REPEAT/UNTIL loop
Title: Re: BREAK/CONTINUE does not work inside REPEAT/UNTIL
Post by: Moru on 2010-Oct-15
The manual says break is only used in FOR and WHILE loops. So not a bug but mabe a feature request? :-)
Title: Re: BREAK/CONTINUE does not work inside REPEAT/UNTIL
Post by: ampos on 2010-Oct-15
LOL, you name it  ;)
Title: Re: BREAK/CONTINUE does not work inside REPEAT/UNTIL
Post by: Scott_AW on 2010-Oct-15
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.
Title: Re: BREAK/CONTINUE does not work inside REPEAT/UNTIL
Post by: MrTAToad on 2010-Oct-15
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.
Title: Re: BREAK/CONTINUE does not work inside REPEAT/UNTIL
Post by: Scott_AW on 2010-Oct-15
Have you tried using CONTINUE and triggering the UNTIL?

What do you have going on in the loop?