JSBasic icon indicating copy to clipboard operation
JSBasic copied to clipboard

GOTOs inside FOR and WHILE loops break execution flow

Open kara1001000 opened this issue 7 years ago • 1 comments

Thanks for this interesting project! I tried to modify it for MBASIC, a Basic dialect from the CP/M times, and had some success after adding support for a few things such as "ON .. GOTO/GOSUB" and "DATA" & "READ" statements. However, I also found a major issue: whenever there is a GOTO inside a loop (before NEXT), execution flow breaks on JS as we'll have a return statement inside the loop. I couldn't figure out any easy way to solve this (especially as labeled continue and break only work backwards in JS). Perhaps you have some ideas how to fix this?

kara1001000 avatar Aug 14 '18 15:08 kara1001000

Hi there, I'm afraid I probably can't provide any help. From memory, fixing that would need a fundamental change to the way it works. It was over ten years ago that I wrote it though so I could be wrong.

danielflower avatar Aug 15 '18 09:08 danielflower