There is no way to interpret what John described, as "forget that it is in a subroutine and not understand the return statement", and no way to interpret what you described as a stack.
You definitely said very different things, not the same thing in diffrent ways. -- bkw On Mon, Dec 10, 2018, 3:13 AM Peter Vollan <dprogra...@gmail.com wrote: > That is just a more verbose way of saying what I already said. > On Sun, 9 Dec 2018 at 19:04, John R. Hogerhuis <jho...@pobox.com> wrote: > > > > " It seems that a limitation of the model > > 100 is that if you gosub to a subroutine, and then gosub again, it > > will forget that it is it in a subroutine, and not understand the > > retrurn statement." > > > > That's not how it works. GOSUB stacks addresses. It means your gosubs > and returns are not balanced, which is a bug in your code. > > > > Think of a GOSUB as pushing the location of the next BASIC command onto > a stack. > > > > At some point, you RETURN and it pops that location from the stack and > jumps there. > > > > If you get a "RETURN without GOSUB" it means you tried to RETURN when > the stack was empty! > > > > -- John. >