Contents / Reference section / Previous chapter / Next chapter / Index


46 Error messages

If the computer is unable to proceed for some reason then it will report that fact to you by printing an error message on the screen. The printing of the message can be supressed by the statement, for example

ON ERROR GOTO 9000

provided that some special routines had been written in line 9000. As well as the error message the computer sets two variables each time an error occurs.

ERR gives the "Error number"

ERL gives the number of the line in the program where the error occurred.

The error messages are listed below in alphabetical order together with their error numbers

Accuracy lost 23

If you try to calculate trigonometric functions with very large angles you are liable to lose a great deal of accuracy in reducing the angle to the range of plus or minus PI radians. In this case the computer will report Accuracy lost.e.g.

PRINT SIN(10000000)

Arguments 31

This error indicates that there are too many or too few arguments for a given function or procedure.

Array 14

This indicates that the computer thinks that an array is to be accessed but does not know the array in question.

Bad call 30

This indicates that the use of PROC or FN to call a defined procedure or function is incorrect.

Bad DIM 10

Arrays must be dimensioned with a positive number of elements. An error will be produced for example by

DIM A(-3)

Bad hex 28

Hex numbers can only include 0 to 9 and A to F. An attempt to form a hex number with other letters will result in this error e.g.

PRINT &y

Bad MODE 25

This indicates an attempt to change MODE inside a procedure or function, or to select a mode for which there is insufficient

memory.

Bad program 0

There are a number of occasions on which the computer checks to see where the program that it contains starts and ends in memory. The untrapable error BAD program indicates that the computer could not follow a program through successfully to an end mark in memory. This is caused by a read error or by only loading part of a program or by overwriting part of the program in some way. Unless you are prepared to check the contents of memory a byte at a time there is little that can be done to recover a bad program.

Block? 218

This is an error generated by the cassette filing system. It indicates that an unexpected block number was encountered. Rewind the tape a short way and play it again.

Byte 2

An attempt was made, during an assembly language section, to load a register with a number requiring more than one byte e.g.

LDA #345

Can't match FOR 33

There is no FOR statement corresponding to the NEXT statement.

Channel 222

This error is generated by the cassette filing system if an attempt is made to use a channel that was not opened.

Data? 216

This is an error generated by the cassette filing system and it means that the computer has found a Cyclic Redundancy Check (CRC) error. The CRC is stored on the tape along with other internal information - see page 399 for more information. Rewind the tape a short way and play it again.

DIM space 11

An attempt was made to dimension an array for which there was insufficient room.

Division by zero 18

Division by zero cannot be done! e.g.

PRINT 34/0

This error can also be caused by a division within a procedure or function using a LOCAL variable which has not been set to a new value. When a variable is declared as LOCAL it is set to zero.

$ range 8

The user may put strings into any place in memory except zero page, that is locations less than 100 hex. Thus this is illegal:

$40="hello"

Eof 223

This error is generated by the cassette filing system if the end of the file is reached.

Escape 17

The ESCAPE key has been pressed.

Exp range 24

The function EXP cannot deal with powers greater than 88. Thus the following is illegal.

X=EXP (90)

Failed at 0

When renumbering a program the computer attempts to look after all references made by GOTO and GOSUB statements. Thus the program

133 GOTO 170

170 END

would become

10 GOTO 20

20 END

when renumbered. However, the computer would not be able to deal with

133 GOTO 140

200 END

If the user attempts to renumber this program he will get the error message

Failed at 10

and the renumbered program will be

10 GOTO 140

20 END

File? 219

This error generated by the cassette filing system indicates that an unexpected file name was encountered by the computer.

FOR variable 34

The variable in a FOR...NEXT loop must be a numeric variable. Thus the following is illegal

FOR 5=3 TO 10

Header? 217

This is an error generated by the cassette filing system and it indicates that a header Cyclic Redundancy Check error has occurred - see page 399 for further information. Rewind the tape a short way and play it again.

Index 3

This indicates an error in specifying an index mode when using the assembler e.g. LDA Z,Z.

LINE space

The computer has no room left to insert the line in the program.

Log range 22

An attempt was made to calculate the LOG of a negative number or of zero. e.g. PRINT LOG(-10)

Missing , 5

This error indicates that the computer expected to find a comma in the line, and didn't do so, e.g.

D$=MID$(A$)

Missing " 9

The computer expected to find a double quote. e.g.

LOAD "FRED

Missing ) 27

The computer expected a closing bracket. e.g.

PRINT TAB(10,10

Mistake 4

This indicates that the computer could not make any sense of the input line.

-ve root 21

An attempt was made to calculate the square root of a negative number. e.g.

PRINT SQR(-10)

This may also occur with ASN and ACS.

No GOSUB 38

A RETURN statement was found when no GOSUB statement had been encountered.

No FN 7

This indicates that the computer detected the end of a function but had not called a function definition. e.g.

=FNsue

No FOR 32

A NEXT statement was found when no FOR statement had been encountered.

No PROC 13

This indicates that the word ENDPROC was found without there being a corresponding DEF PROC statement.

No REPEAT 43

The interpreter found an UNTIL statement when no REPEAT statement had been encountered.

No room 0

This untrapable error indicates that while the computer was running a program it used up all available memory.

No such FN/PROC 29

If the interpreter meets a name beginning with FN (e.g. FNfred) or PROC (e.g. PROCsteve) it expects to be able to find a corresponding function or procedure definition somewhere. This error indicates that no matching definition was found.

No such line 41

The computer was told to GOTO or GOSUB a line number which does not exist.

No such variable 26

All variables must be assigned to, or made LOCAL, before they can be accessed in PRINT statments or before their values can be assigned to other variables. The initial assignment can simply be for example, X=0.

No TO 36

A FOR...NEXT loop has been set up with the TO part missing. A correctly formed line is shown below

FOR X=10 TO 55

Not LOCAL 12

This indicates the appearance of LOCAL outside a procedure or function.

ON range 40

The control variable was either less than 1 or greater than the number of entries in the ON list. For example if X=3 then this will fail.

ON X GOTO 100,200

since there are only two destinations.

ON syntax 39

The ON...GOTO statement was misformed, for example this is illegal

ON X PRINT

The word ON must be followed by a numeric variable which must in turn be followed by the word GOTO or GOSUB.

Out of DATA 42

An attempt was made to read more items of DATA than there were in the DATA list. The word RESTORE can be used to reset the data pointer to the start of the DATA if required.

Out of range 1

An attempt was made to branch out of range of the branch instruction in the assembler.

Silly 0

This message will be issued if you attempt to renumber a program or enter AUTO mode with a step size of 0 or more than 255. e.g.

AUTO 100,0

Syntax 220

This error is generated by the cassette filing system. It indicates that a syntax error, such as an illegal *OPT statement has occurred.

String too long 19

The maximum length of a string is 255 characters.

Subscript 15

This implies that an attempt was made to access an element of an array less than zero or greater than the size of the array. For example these two lines together will produce this error.

100 DIM A(10)

120 A(15)=3

Syntax error 16

A command was terminated wrongly for example

LIST PRINT

Too big 20

A number was entered or calculated which was too large for the computer to handle.

Too many FORs 35

An attempt was made to "nest" too many FOR...NEXT loops. The maximum nesting allowed is 10. This can sometimes be caused by returning to a FOR statement without executing a NEXT statement. e.g.

10 FOR X=1 TO 6

20 GOTO 10

Too many GOSUBs 37

An attempt was made to "nest" too many

GOSUB...RETURN loops. The maximum nesting allowed is

26. This can sometimes be caused by returning to a GOSUB

statement without executing a RETURN statement. e.g.

10 PRINT "WRONG"

20 GOSUB 10

Too many REPEATs 44

An attempt was made to "nest" too many REPEAT...UNTIL loops. The maximum nesting allowed is 20. This can sometimes be caused by returning to a REPEAT statement without executing an UNTIL statement. e.g.

10 REPEAT

20 GOTO 10

Type mismatch 6

This error indicates that a number was expected and a string was offered or vice-versa. e.g.

10 A$=X


Error number Error message Error number Error message
1 Out of range 28 Bad Hex
2 Byte 29 No such FN/PROC
3 Index 30 Bad call
4 Mistake 31 Arguments
5 Missing , 32 No FOR
6 Type mismatch 33 Can't match
FOR
7 No FN
8 $ range 34 FOR variable
9 Missing " 35 Too many FORs
10 Bad DIM 36 No TO
11 DIM space 37 Too many GOSUBs
12 Not LOCAL
13 No PROC 38 No GOSUB
14 Array 39 ON syntax
15 Subscript 40 ON range
16 Syntax error 41 No such line
17 Escape 42 Out of DATA
18 Division by zero 43 No REPEAT
19 String too long 44 Too many REPEATs
20 Too big
21 -ve root 216 Data?
22 Log range 217 Header?
23 Accuracy lost 218 Block?
24 Exp range 219 File?
25 Bad MODE 220 Syntax
26 No such variable 222 Channel
27 Missing ) 223 Eof

Exit: BBC Microcomputer User Guide; Kasoft Typesetting; Archer


The BBC Microcomputer User Guide was written by John Coll and edited by David Allen for the British Broadcasting Corporation.

Optical character recognition and original formatting effort by Mark Usher.

HTML version maintained by: Kade "Archer" Hansson; e-mail: archer@dialix.com.au

Last updated: Monday 12th February 2001