robhagemans / pcbasic

PC-BASIC - A free, cross-platform emulator for the GW-BASIC family of interpreters
http://www.pc-basic.org
Other
396 stars 48 forks source link

Syntax Error instead of program end with ON x GOSUB #139

Closed robhagemans closed 2 years ago

robhagemans commented 3 years ago

https://sourceforge.net/p/pcbasic/discussion/bugs/thread/49a22a070f/#3764

If the value of the expression higher than the quantities of the line numbers after GOSUB, a SYNTAX ERROR occurs:

10 A = 3 20 ON A GOSUB 30, 40: END 30 PRINT "1": RETURN 40 PRINT "2": RETURN

https://sourceforge.net/p/pcbasic/discussion/bugs/thread/49a22a070f/#3764/2f87

I can confirm this and that GW-BASIC doesn't do this. The program just ends there.

robhagemans commented 2 years ago

Fixed on develop by commit 09cb303eb, thanks @rbergen !