Skip to content

Every error message

An error stops your program, prints a line, and gives you the prompt back. Nothing is lost — LIST still shows the program, and the variables still hold what they held.

Reading one

?SYNTAX ERROR IN 60
  • ? — every error starts with one.
  • SYNTAX ERROR — what went wrong.
  • IN 60 — which line. No line number means it happened at the prompt.

The list

?SYNTAX ERROR

BASIC could not read the line at all.

Usually: A missing bracket or quote, a misspelled keyword — or a variable name with a keyword buried in it, like SCORE, which contains OR.

?OVERFLOW ERROR

A number got too big to hold.

Usually: Anything past about 1.7 × 10³⁸. Usually a runaway multiplication, or a division that should have been the other way up.

?OUT OF MEMORY ERROR

No room left.

Usually: A very long program or a big DIM — but far more often GOSUBs that never RETURN, or loops jumped out of and never finished. Both leave litter behind that adds up.

?UNDEF'D STATEMENT ERROR

A jump to a line that does not exist.

Usually: GOTO or GOSUB pointing at a deleted line, or a FN called before its DEF has run.

?BAD SUBSCRIPT ERROR

An array index outside the array.

Usually: Remember DIM S(4) gives you S(0) to S(4). Also what you get for a two-dimensional DIM, which this BASIC does not have.

?REDIM'D ARRAY ERROR

The same array was DIMmed twice.

Usually: Usually a DIM inside a loop or in a subroutine that gets called more than once. DIM each array once, near the top.

?DIVISION BY ZERO ERROR

Something was divided by zero.

Usually: Check the divisor with an IF before you divide by a variable.

?ILLEGAL DIRECT ERROR

A statement that only works inside a program was typed at the prompt.

Usually: INPUT is the one you will meet. Give the line a number and RUN it.

?TYPE MISMATCH ERROR

A string where a number belongs, or the other way around.

Usually: Nearly always a missing or stray $.

?STRING TOO LONG ERROR

A string went past 255 characters.

Usually: Usually a loop that keeps adding to the same string.

?FORMULA TOO COMPLEX ERROR

An expression nested deeper than BASIC can follow.

Usually: Break it into two lines with a variable in between.

?ILLEGAL QUANTITY ERROR

An argument outside what the function or statement allows.

Usually: A negative SQR, a CHR$ over 255, a LOCATE row past 23, a HEX over 65535, a negative ON.

?RETURN WITHOUT GOSUB ERROR

A RETURN with no GOSUB waiting.

Usually: Classically, a main program with no END that runs on into its own subroutines.

?NEXT WITHOUT FOR ERROR

A NEXT with no loop open.

Usually: A NEXT naming the wrong variable — or the comma form, NEXT J, I, which this BASIC does not accept. Give each loop its own NEXT.

?OUT OF DATA ERROR

READ ran off the end of the DATA.

Usually: A missing sentinel value, or a loop that reads once too often.

?NO DEVICE ERROR

The card being asked for is not fitted.

Usually: PEEK(781) or MEM will tell you what the machine actually found at switch-on.

?CAN'T CONTINUE ERROR

CONT has nothing to go back to.

Usually: Either nothing had stopped, or the program was edited after it stopped. Editing always throws the resume point away.

Messages that are not errors

These print and carry on. Nothing is wrong.

?REDO FROM STARTINPUT wanted a number and got something else. It asks again.
?EXTRA IGNOREDINPUT got more answers than it asked for. It keeps the first.
BREAK IN 20You pressed Esc, or the program hit STOP. CONT carries on.

Messages from the memory card

?LOAD ERRORThe file isn't there, or isn't readable. Check DIR and check which DISK you're on.
?SAVE ERRORIt couldn't be written. Usually a full disk.
?DEL ERRORThe file couldn't be removed. Usually it wasn't there.

When there's no message at all

The machine is doing exactly what you told it, and what you told it was wrong. When it goes wrong is the chapter for that.

Written for BIOS v1.5. Released under the MIT License.