What are the difference between a BASIC GOTO and GOSUB statement

Morufu Salawu picture Morufu Salawu · Oct 10, 2012 · Viewed 10.5k times · Source

What are the difference between a GOTO and a GOSUB statements in BASIC programming language?

Answer

Collin picture Collin · Oct 10, 2012

GOTO simply jumps to another line, GOSUB keeps track of where it came from (on a stack, presumably), so when the interpreter encounters a RETURN, it goes back to the last place GOSUB was called.