<!-- PDF page 288 -->

## Appendix B – Reference

The following sections provide a handy reference of Error Codes and their equivalent Reports, NextBASIC keywords and functions as well as other information discussed so far in a consice form

### Reports and Error Codes

These appear at the bottom of the screen whenever the computer stops executing some function, and explain why it stopped, whether for a natural reason, or because an error occurred.

The report has a brief message explaining what happened and the bank number (not present unless the error occurred in a banked section of program), the line number and statement number within the 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). Some of the codes will have a code number or letter so that you can refer to the tables below. There are two types of error reports: *General* and Sto*rage System related.*

### General Errors

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**.

Below, there is a table showing all the reports together with the circumstances they can occur.

| Code | Report | Description | Situation |
|---|---|---|---|
| 0 | OK | 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**. | Any |
| 1 | NEXT without FOR | 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. | **NEXT** |
| 2 | Variable not found | 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 a storage device. | Any |
| 3 | Subscript wrong | 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. | Subscripted variables, substrings |
| 4 | Out of memory | 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 **DELETE** 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**. | **LET**, **INPUT**, **FOR** , **DIM**, **GO SUB**, **LOAD**, **MERGE**, **BANK**, **PALETTE**, **SPRITE**, **LAYER**, **TILE**. Sometimes during expression evaluation |
| 5 | Out of screen | An **INPUT** statement has tried to generate more than 23 lines in the lower half of the screen. Also occurs with **PRINT AT 22, …**, **TILE** and **SPRITE**. | **INPUT**, **PRINT AT**, **SPRITE**, **TILE** |
| 6 | Number too big | Calculations have led to a number greater than about 10³⁸. | Any arithmetic |
| 7 | RETURN without GO SUB | There has been one more **RETURN** than there were **GO SUB**s. | **RETURN** |
| 8 | End of file |  | Storage device, etc, operations |
| 9 | STOP statement | After this, **CONTINUE** will not repeat the **STOP**, but carries on with the statement after. | **STOP** |

