Specifically, whenever a `goto` is encountered after a subroutine, but before any labels, an "unreachable statement" error is thrown.
The following minimal example demonstrates this behavior:
Code: Select all
sub a
endsub
goto jumpAround
jumpAround:
MAIN:
Code: Select all
// main.bas
#include "a.bas"
#include "b.bas"
MAIN:
a
b
Code: Select all
// a.bas
sub a
print "sub a"
endsub
Code: Select all
// b.bas
#include <c.bas>
sub b
print "sub b"
c
endsub
Code: Select all
// c.bas
goto jumpAroundC
sub c
print "sub c"
endsub
jumpAroundC: