What I'm trying to tell you is that "break" is compiled without warning or error. You can even run the program, and then, "break" is not executed as "exit loop" or whatever... it' actually as it was a nop.
Try this:
Compile it with this:
And then it compiles okay (not even warnings), then you run it in the emulator, and the output is 11.
Try this:
Code:
dim m(10) as byte => { 11, 22, 33, 44, 55, 66, 77, 88, 99, 100, 110 }
for i = 0 to 10
if m( i ) = 66
break
end if
next
print "i = "; i
Compile it with this:
Code:
python ~/bin/zxbasic/zxbc.py -f tap --BASIC --autorun --debug-array sample.bas
And then it compiles okay (not even warnings), then you run it in the emulator, and the output is 11.
Code:
i = 11
-- Baltasar