Appendix C
What did that error mean?
A short message can tell you exactly where to start looking. On our empty practice disk, the flight-log reader stopped with ?NE ERROR IN 20. The two letters identify the problem. The number after IN is the line BASIC was trying to execute.
Look up the code
/0 · AE · AO · BR · BS · CN · DD · DF · DN · DS · ER · FC · FD · FM · FN · FO · FS · HP · HR · ID · IE · IO · LS · NE · NF · NO · OB · OD · OM · OS · OV · RG · SE · SN · ST · TM · UL · VF · WP
For the flight-log example, NE means “file not found.” Open LOGBOOK.bas and look at line 20. It asks drive zero to open a file called VOYAGE.DAT for input. Is the practice disk in FD0? Has the crew already landed and saved a voyage? Either answer is more helpful than changing line 20 at random.
For a program of your own, note the code and line number before starting over. Choose that line in the editor and read it together with the line above it. A bad value can be assigned much earlier than the line that first tries to use it. A breakpoint and a watch let you catch the change while the program is still running.
Check the value
Give each operation the sort of value it expects.
/0 — Division by zero
A denominator evaluated to zero. Check the values at the reported line.
See also IF, Choose a destination.
FC — Illegal function call
An argument is outside the range accepted by this command or function. Check its parameter descriptions.
See also SQR, ASC, Choose a destination.
LS — String too long
The result exceeds BASIC's maximum string length of 255 characters.
See also LEN, LEFT$, MID$, Choose a destination.
OV — Overflow
A numeric result is too large for BASIC to represent.
See also EXP, Choose a destination.
OS — Out of string space
The reserved string workspace is exhausted. Consider reserving more with CLEAR before creating data.
See also CLEAR, LEN, Choose a destination.
ST — String expression too complex
Simplify the expression by saving intermediate string results in variables.
See also LET, MID$, Choose a destination.
TM — Type mismatch
An expression uses a string where a number is required, or the reverse.
See also VAL, STR$, INPUT, Choose a destination.
Trace the program
Start at the reported line. Check how control reached it.
CN — Cannot continue
BASIC no longer has a valid continuation after a stop. Restart with RUN if appropriate.
See also CONT, RUN, STOP, Find the missing supply.
DS — Direct statement in file
A program being loaded contains a statement without a BASIC line number.
See also LOAD, MERGE, Find the missing supply.
ID — Illegal direct statement
This statement requires execution from a numbered program rather than the immediate prompt.
See also RUN, Find the missing supply.
NF — NEXT without FOR
Execution reached NEXT without a matching active loop. Check loop entry paths.
See also FOR, NEXT, Find the missing supply.
RG — RETURN without GOSUB
There is no active subroutine call to return from. Avoid falling into a subroutine from the main program.
See also GOSUB, RETURN, END, Find the missing supply.
SN — Syntax error
BASIC could not interpret a statement. Check spelling, punctuation, quotes and the command form.
See also PRINT, Find the missing supply.
UL — Undefined line
A branch or run command refers to a line that is not in the program.
See also GOTO, GOSUB, RUN, Find the missing supply.
Count the items
Compare the number of items you set aside with the number you used.
BS — Bad subscript
An array index is outside its declared bounds or has the wrong number of dimensions.
See also DIM, Give a chart its names.
DD — Duplicate dimension
An array has already been dimensioned or implicitly created. Dimension it before its first use.
See also DIM, Give a chart its names.
OD — Out of DATA
READ requested more values than the DATA statements provide.
See also DATA, READ, RESTORE, Give a chart its names.
OM — Out of memory
BASIC has insufficient workspace for the operation. Check arrays, strings, graphics pages and program size.
See also MEM, CLEAR, DIM, PCLEAR, Give a chart its names.
Check the screen mode
Match the graphics mode, coordinates and buffers to the drawing command.
HP — High-resolution print error
The requested high-resolution text operation is invalid. Check the display mode and coordinates.
See also HPRINT, HSCREEN, Draw a planet you can find again.
HR — High-resolution graphics error
A CoCo 3 graphics argument or buffer is invalid. Check coordinates, mode and allocated buffer size.
See also HSCREEN, HBUFF, HGET, HPUT, Draw a planet you can find again.
Check the open file
Look for OPEN, its file number and its mode, then follow each read or write.
AO — Already open
The file is already open. Close it before reopening; on SDC, an image cannot be mounted twice.
See also CLOSE, OPEN, DRIVE — SDC-DOS, Keep a log past bedtime.
BR — Bad record
The direct-access record number is invalid.
See also GET — disk record, PUT — disk record, LOC, LOF, Keep a log past bedtime.
ER — End of record
A direct-access operation went beyond the current record boundary. Check record size and fields.
See also OPEN, FIELD, Keep a log past bedtime.
FD — Bad file data
The next input value cannot be read into the requested variable type.
See also INPUT, INPUT — disk file, WRITE, Keep a log past bedtime.
FM — File mode
The operation does not match the mode used to open the file.
See also OPEN, Keep a log past bedtime.
FO — Field overflow
FIELD definitions exceed the file buffer's record size.
See also FIELD, OPEN, Keep a log past bedtime.
IE — Input past end
The program tried to read beyond the end of a file. Test EOF before requesting another item.
See also EOF, Keep a log past bedtime.
NO — File not open
Open the file before reading, writing or requesting its records.
See also OPEN, CLOSE, Keep a log past bedtime.
OB — Out of buffers
No suitable disk buffer is available. Allocate the required file buffers before opening files.
See also FILES, OPEN, Keep a log past bedtime.
SE — Not a field string
LSET or RSET was given a string that is not currently mapped by FIELD.
See also FIELD, LSET, RSET, Keep a log past bedtime.
Check the disk or device
Check the filename and the device that answered the request.
AE — File already exists
The destination name is already in use. Choose another name or use the documented replacement behavior.
See also COPY, COPY — RGB-DOS, RENAME, Take the voyage to another machine.
DF — Disk full
There is insufficient space for the write. Use another working image or remove unneeded files carefully.
See also FREE, DIR, Take the voyage to another machine.
DN — Device number
The selected device or drive number is not valid for this operation.
See also OPEN, DRIVE, Take the voyage to another machine.
FN — Bad filename
The filename is not valid for the selected filesystem. Check its length, extension and drive syntax.
See also LOAD, SAVE, Take the voyage to another machine.
FS — Bad file structure
The disk file or filesystem structure is inconsistent with the requested operation.
See also DIR, Take the voyage to another machine.
IO — Input/output error
The requested media operation failed. Check mounting, format, filename and the selected drive.
See also DIR, DRIVE, CLOAD, Take the voyage to another machine.
NE — File not found
The named disk file was not found on the selected drive. Check DIR, extension and drive suffix.
See also DIR, LOAD, DRIVE, Take the voyage to another machine.
VF — Verification error
Data read back after a write did not verify. Preserve another copy before continuing to modify the image.
See also VERIFY, Take the voyage to another machine.
WP — Write protected
The selected media is read-only. Change protection only if you intend to modify that working copy.
See also SAVE, DRIVE — SDC-DOS, Take the voyage to another machine.