Is it safe to END a program after a GOSUB without a RETURN. It occurred to me since BASIC is the "OS" this could cause problems with subsequent programs. ?
Most of my BASIC experience is compiled basic on x86 and this was never a problem there.
END from within GOSUB
Re: END from within GOSUB
Yes, END within a GOSUB is fine. The RUN command does an implied NEW, which resets variables, the FOR loop registers, and the stack.
- ahenry3068
- Posts: 1195
- Joined: Tue Apr 04, 2023 9:57 pm
Re: END from within GOSUB
I'm happy for the answer. Thank You. I suspected is was OK but I've had some weird memory management errors come up
when programming in C & Pascal on 16 bit MS-DOS and Windows in the past....
Again, thanks for the answer.
when programming in C & Pascal on 16 bit MS-DOS and Windows in the past....
Again, thanks for the answer.
- ahenry3068
- Posts: 1195
- Joined: Tue Apr 04, 2023 9:57 pm
Re: END from within GOSUB
I want a universal quit Key for a Craps game I'm working on. Easier to do a GOSUB after input no matter
where you are in the game. Then I just need to RETURN if the user doesn't want to quit.
where you are in the game. Then I just need to RETURN if the user doesn't want to quit.