7 RETURN without GO SUB

Sinclair ZX Spectrum

Severity: Minor

What it means

Sinclair's manual: there has been one more RETURN than there were GO SUBs.
Often the main program has run on into a subroutine and reached its RETURN.

Affected Models

  • Sinclair ZX Spectrum 16K and 48K
  • ZX Spectrum+
  • Spectrum 128, +2 and +3 in 48 BASIC

How to Fix It

  1. Put STOP on the line just before the first subroutine.

    Spectrum BASIC has no END statement. STOP ends the program with report 9 STOP statement.

  2. Check that each subroutine is reached with GO SUB, not GO TO.