Appendix B: Reports

BASin

Appendix B: Reports

These appear in the Error window whenever the computer stops executing some BASIC, and explain why it stopped, whether for a natural reason, or because an error occurred.

The report has a code number or letter so that you can refer to the table here, a brief message explaining what happened and the line number and statement number within that line where it stopped. (A command is shown as line 0. Within a line, statement 1 is at the beginning, statement 2 comes after the first colon or THEN, and so on.)

The behaviour of CONTINUE depends very much on the reports. Normally, CONTINUE goes to the line and statement specified in the last report, but there are exceptions with reports 0, 9 and D (also see Appendix C).

Here is a table showing all the reports. It also tells you in what circumstances the report can occur, and this refers you to Appendix C. For instance error A Invalid argument can occur with SQR, IN, ACS and ASN and the entries for these in Appendix C tell you exactly what arguments are invalid.

Code

Meaning

Situations

0

OK

Any
Successful completion, or jump to a line number bigger than any existing. This report does not change the line and statement jumped to by CONTINUE.

1

NEXT without FOR

NEXT
The control variable does not exist (it has not been set up by a FOR statement), but there is an ordinary variable with the same name.

2

Variable not found

Any
For a simple variable this will happen if the variable is used before it has been assigned to in a LET, READ or INPUT statement or loaded from tape or set up in a FOR statement. For a subscripted variable it will happen if the variable is used before it has been dimensioned in a DIM statement or loaded from tape.

3

Subscript wrong

Subscripted variables, Substrings
A subscript is beyond the dimension of the array, or there are the wrong number of subscripts. If the subscript is negative or bigger than 65535, then error B will result.

4

Out of memory

LET, INPUT, FOR, DIM, GO SUB, LOAD, MERGE.
Sometimes during expression evaluation, there is not enough room in the computer for what you are trying to do. If the computer really seems to be stuck in this state, you may have to clear out the command line using Backspace and then delete a program line or two (with the intention of putting them back afterwards) to give yourself room to manoeuvre with - say - CLEAR.

5

Out of screen

INPUT, PRINT AT
An INPUT statement has tried to generate more than 23 lines in the lower half of the screen. Also occurs with PRINT AT 22, . . .

6

Number too big

Any arithmetic
Calculations have led to a number greater than about 1038.

7

RETURN without GO SUB

RETURN
There has been one more RETURN than there were GO SUBs.

8

End of file

Microdrive, etc operations

9

STOP statement

STOP
After this, CONTINUE will not repeat the STOP, but carries on with the statement after.

A

Invalid argument

SQR, LN, ASN, ACS, USR (with string argument)
The argument for a function is no good for some reason.

B

Integer out of range

RUN, RANDOMIZE, POKE, DIM, GO TO, GO SUB, LIST, LLIST, PAUSE, PLOT, CHR$, PEEK, USR (with numeric argument), Array access
When an integer is required, the floating point argument is rounded to the nearest integer. If this is outside a suitable range then error B results. For array access, see also error 3.

C

Nonsense in BASIC

VAL, VAL$
The text of the (string) argument does not form a valid expression.

D

BREAK - CONT repeats

LOAD, SAVE, VERIFY, MERGE, LPRINT, LLIST, COPY.
Also when the computer asks scroll? and you type N, Space or STOP.
Break was pressed during some peripheral operation. The behaviour of CONTINUE after this report is normal in that it repeats the statement. Compare with report L.

E

Out of DATA

READ
You have tried to READ past the end of the DATA list.

F

Invalid file name

SAVE
SAVE with name empty or longer than 10 characters (on an original Spectrum).

G

No room for line

Entering a line into the program
There is not enough room left in memory to accommodate the new program line.

H

STOP in INPUT

INPUT
Some INPUT data started with STOP, or - for INPUT LINE - was pressed. Unlike the case with report 9, after report H CONTINUE will behave normally, by repeating the INPUT statement.

I

FOR without NEXT

FOR
There was a FOR loop to be executed no times (e.g. FOR n=1 TO 0) and the corresponding NEXT statement could not be found.

J

Invalid I/O device

Microdrive, etc operations

K

Invalid colour

INK, PAPER, BORDER, FLASH, BRIGHT, INVERSE, OVER; also after one of the corresponding control characters.
The number specified is not an appropriate value.

L

BREAK into program

Any
Break pressed. This is detected between two statements. The line and statement number in the report refer to the statement before Break was pressed, but CONTINUE goes to the statement after (allowing for any jumps to be done), so it does not repeat any statements.

M

RAMTOP no good

CLEAR; possibly in RUN
The number specified for RAMTOP is either too big or too small.

N

Statement lost

RETURN, NEXT, CONTINUE
Jump to a statement that no longer exists.

O

Invalid stream

Microdrive, etc operations

P

FN without DEF

FN
A user-defined function was called but no corresponding definition could be found.

Q

Parameter error

FN
Wrong number of arguments, or one of them is the wrong type (string instead of number or vice versa).

R

File loading error

VERIFY, LOAD or MERGE
A file on disk could not be read in, or would not verify.

The following reports are 128k only, and will only appear when using one of the 128k commands. They are not common to the 48k Spectrum, hence their code appearing in reports in lower case.

Code

Meaning

Situations

a

MERGE error

MERGE !
MERGE ! would not execute for some reason - either size or file type wrong.

b

Wrong file type

MERGE !, LOAD !
A file of inappropriate type was specified during silicon disc operation, for instance a CODE file in LOAD ! "name".

c

CODE error

LOAD ! "file" CODE
The size of the file would overrun the top of memory.

d

Too many brackets

PLAY
Too many brackets around a repeated phrase in one of the arguments.

e

File already exists

SAVE !
The file name specified has already been used.

f

Invalid name

ERASE !
The file name specified is empty or above 10 characters in length.

h

File does not exist

LOAD !, ERASE !
There is no file in the silicon disc that has the name specified.

i

Invalid device

FORMAT
The device name following the FORMAT command does not exist or orrespond to a physical device.

j

Invalid baud rate

FORMAT
The baud rate for the RS232 was set to zero.

k

Invalid note name

PLAY
PLAY came across a note or command it didn't recognise, or a command that was in lower case.

l

Number too big

PLAY
A parameter for a command is an order of magnitude too big.

m

Note out of range

PLAY
A series of sharps or flats has taken a note beyond the range of the sound chip.

n

Out of range

PLAY
A parameter for a command is too big or too small. If the error is very large, error "l" results.

o

Too many tied notes

PLAY
An attempt was made to tie too many notes together.

Appendix C

Appendix A