Mail webatequ.in   Home Home

Spectrum BASIC errors

Following a discussion on comp.sys.sinclair about BASIC error reports, I tried to reproduce all of the errors.

Here are my findings, with a few contributions from Philip Kendall, Geoff Wearmouth, and Paul Dunn.

0 OK

REM

1 NEXT without FOR

LET n=5: NEXT n

2 Variable not found

PRINT x

3 Subscript wrong

DIM a(3): PRINT a(4)

4 Out of memory

10 GOSUB 10
(leave it running)

5 Out of screen

PRINT AT 22,0

6 Number too big

PRINT 1e38*1e38

7 RETURN without GO SUB

RETURN

8 End of file

OPEN #4,"m";1;"single": PRINT #4;1: CLOSE #4: OPEN #4,"m";1;"single": INPUT #4, a: INPUT #4, a
(only works with Interface 1)

9 STOP statement

STOP

A Invalid argument

PRINT SQR -1

B Integer out of range

CLEAR -1

C Nonsense in BASIC

PRINT VAL ""

D BREAK - CONT repeats

LOAD ""
(press Break)

E Out of DATA

READ x

F Invalid file name

SAVE ""

G No room for line

10 DIM a$(41450)
RUN
20 REM eeeeeeeeeeeeeee

(only works in 48K mode)

H STOP in INPUT

INPUT x
(enter STOP using Symb Shift + A)

I FOR without NEXT

FOR n=1 TO 0

J Invalid I/O device

INPUT #2, x

K Invalid colour

INK 10

L BREAK into program

PAUSE 1000
(press Break)

M RAMTOP no good

CLEAR 1

N Statement lost

:STOP
CONTINUE

O Invalid stream

PRINT #9

P FN without DEF FN

PRINT FN x()

Q Parameter error

10 DEF FN x()=1: PRINT FN x(1)

R Tape loading error

LOAD ""
(play a tape and stop it while loading)

a MERGE error

(never generated)

b Wrong file type

SAVE !"x": LOAD !"x" CODE
(only works on a +2)

c CODE error

SAVE !"y" CODE 40000,200: LOAD !"y" CODE 40000,100
(only works on a +2)

d Too many brackets

PLAY "((((("

e File already exists

SAVE !"x": SAVE !"x"
(only works on a +2)

f Invalid name

ERASE !""
(only works on a +2)

g File does not exist

(never generated)

h File does not exist

ERASE !"z"
(only works on a +2)

i Invalid device

FORMAT "printer";1

j Invalid baud rate

FORMAT "p";0

k Invalid note name

PLAY "q"

l Number too big

PLAY "N123456"

m Note out of range

PLAY "O8#########B"

n Out of range

PLAY "N50"

o Too many tied notes

PLAY "10_10_10_10_10"

p [copyright message]

10 PRINT "1", "2", "3", "4", "5", "6", "7", "8", "9"
POKE 23759,164
(changing PRINT to PLAY)
RUN

Error p is a special case. It occurs when you try to PLAY more than eight channels simultaneously, which would usually be impossible: the BASIC interpreter won't accept the command, so the POKE above is the only way to produce it. The error message is the system copyright message, but should probably be something like "Too many channels". On the +3, this unused oddity is replaced by a floppy disk error ("Bad filename").

This page was last updated 1065 days ago.

Top Top of page   Home Home