implied END before appended imports

Here we can discuss about the problem found
Post Reply
Stuart
Posts: 177
Joined: Fri Feb 19, 2021 7:46 pm
Location: Chester, UK
Has thanked: 8 times
Been thanked: 25 times

implied END before appended imports

Post by Stuart »

Noting this error below, caused when code runs through into imported gosubs, should there not be an implied 'END' prior to appended imported files? Letting code run through is obv bad practice, but this would not cause an error without imports, which are invisible.

main program
------------
IMPORT "/File2.bas"
wlog "import file2"
gosub file2
wlog "back to main"
wlog "stopping"
end 'if the END is not present, the error below is reported.


file2 contents
--------------
file2:
wlog "in file 2"
return

23/11/2024 11:11:55 -> Program Running
import file2
in file 2
back to main
stopping
in file 2

Return without gosub at line 3 file /File2.bas
23/11/2024 11:11:55 -> Program Stopped
User avatar
cicciocb
Site Admin
Posts: 2781
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 592 times
Been thanked: 1990 times
Contact:

Re: implied END before appended imports

Post by cicciocb »

I thought I had added a hidden END, but that doesn't seem to be the case.
Okay, I'll correct it.
Post Reply