GO SUB stack window

BASin

GO SUB stack window

The GO SUB stack window is available from the View menu.

GO SUB stack window

The GO SUB stack is a region of memory which keeps track of where your program came from when it executes a GO SUB command. When a RETURN is subsequently executed, the last location stored on this "stack" is taken off, and program execution is sent to that location. This enables you to run subroutines in your program to take the tedium out of doing repetitive functions, and to organise things into blocks of code. As each GO SUB is executed, this stack grows in size. Correspondingly, each RETURN executed will shrink the stack.

Each entry takes the form:

line-number:statement-number

The topmost entry corresponds to the most recently called subroutine.

Click Show Source to jump to the selected line and statement in the editor.