02-10-2025, 09:58 AM
baltasarq Wrote: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:
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
Oh, then this is obiously a bug.
I'll review the code. As you said it should either EXIT the current (inner) loop or throw syntax error.
---
Boriel
Boriel