ERROR
This page was last modified 11:05, 8 January 2023 by Mars2000you. Based on work by Gdx and Snout.

Contents

Effect

Simulates an error that is specified by its code.

Syntax

ERROR <ErrorNumber>

Parameter

<ErrorNumber> can vary between 1 and 255. As MSX-BASIC uses values 1 to 25 and Disk BASIC values 50 to 81, you can use the non-defined values to generate specific error messages in your programs. Variables are not usable.

Example

10 ON ERROR GOTO 400
20 INPUT "X= ";A
30 IF A>100 THEN ERROR 150
40  IF A<10 THEN ERROR 151
50 END
400 IF ERR=150 THEN PRINT "MAXIMUM 100!"
410 IF ERR=151 THEN PRINT "MINIMUM 10!"
420 RESUME 20
430 ON ERROR GOTO 0

Defined Errors

MSX-BASIC and Disk BASIC

Errors 72 to 75 have been added by version 2 of Disk BASIC, 76 to 81 by version 3 provided by the Nextor operating system.

MSX-BASIC Message Disk BASIC Message
1 NEXT without FOR 50 FIELD overflow
2 Syntax error 51 Internal error
3 RETURN without GOSUB 52 Bad file number
4 Out of DATA 53 File not found
5 Illegal function call 54 File already open
6 Overflow 55 Input past end
7 Out of memory 56 Bad file name
8 Undefined line number 57 Direct statement in file
9 Subscript out of range 58 Sequential I/O only
10 Redimensioned array 59 File not OPEN
11 Division by zero 60 Bad FAT
12 Illegal direct 61 Bad file mode
13 Type mismatch 62 Bad drive name
14 Out of string space 63 Bad sector number
15 String too long 64 File still open
16 String formula too complex 65 File already exists
17 Can't CONTINUE 66 Disk full
18 Undefined user function 67 Too many files
19 Device I/O error 68 Disk write protected
20 Verify error 69 Disk I/O error
21 No RESUME 70 Disk offline
22 RESUME without error 71 Rename across disk
23 Unprintable error 72 File write protected
24 Missing operand 73 Directory already exists
25 Line buffer overflow 74 Directory not found
75 RAM disk already exists
76 Invalid device driver
77 Invalid device or LUN
78 Invalid partition number
79 Partition already in use
80 File is mounted
81 Bad file size


HI-GRAPhics

HI-GRAPHics is an utility written by Arjen Schrijvers - see Interlacing Demo - note that the error messages can be in conflict with Disk BASIC versions 2 and 3.

HI-GRAPHics Message
72 Bad display page
73 Bad screen mode
74 Bad display mode


Delta BASIC

Delta BASIC Message Message
200 ENDPROC without PROC 209 INVALID window
201 DEFPROC not found 210 MISSING definition window
202 ENDPROC not found 211 LOCATE out of window
203 MODE error 212 MEMDISC initialised
204 UNNEW without NEW 213 LINE number too big
205 Program recovered 214 MOVLIN error
206 TOO MUCH varspace 215 COPLIN error
207 NO ROOM for vars 216 STATE size
208 INVALID definition windows

Related to

ERL, ERR, ON ERROR GOTO, RESUME

Compatibility

MSX-BASIC 1.0 or higher