MADE FOR THE NES. READY FOR YOUR IDEAS. NO ACCOUNT NEEDED.
NESBASICBY NDB SOFTWARE

15 NES BASIC PROGRAMMING GUIDE

Errors, recovery and troubleshooting

Read the exact message first. During RUN the suffix IN line identifies the source line. Return to editing, correct that numbered line, and RUN again. Failed line storage keeps the previous valid record. Failed typed assignment keeps its old destination. Reset is not the first repair step: it discards unsaved work.

SYNTAX ERROR often means missing quotes, a parenthesis/comma, extra punctuation, a wrong keyword or an unsupported identifier. BAD NUMBER is a literal outside the numeric domain; OVERFLOW is arithmetic/conversion beyond the checked range. TYPE MISMATCH needs an explicit STR$/VAL conversion or a corrected variable type. BAD INPUT retries an edited numeric answer. A bad string INPUT can retry after STRING TOO LONG or STRING SPACE FULL. Empty strings are valid input but not valid arguments to ASC or VAL.

UNDEFINED LINE means a GOTO/GOSUB/THEN target does not exist. INVALID RETURN means there is no matching GOSUB, or source ended while one was pending. UNMATCHED LOOP means FOR/NEXT frames do not match, including missing NEXT. LOOP VARIABLE IN USE means a nested FOR reuses an active numeric loop variable. CONTROL STACK FULL or EXPRESSION TOO DEEP calls for simpler nesting, not a larger host heap.

GRAPHICS MODE REQUIRED needs SCREEN 1 before drawing/SPRITE/MOVE. BAD ARGUMENT usually signals a range, count, mode parameter or invalid hidden-slot MOVE. FILL TOO COMPLEX is the bounded seed worklist, not a host crash. FILE NOT FOUND, BAD SAVED PROJECT and SAVE DIRECTORY FULL need the file checks in Chapter 12. BREAK is the expected result of an interruption or canceled output page.

CodeExact message
1SYNTAX ERROR
2OUT OF MEMORY
3BAD LINE NUMBER
4BAD NUMBER
5OUTPUT TOO LONG
6DIRECT COMMAND ONLY
7BAD PROGRAM
8BREAK
9OVERFLOW
10DIVISION BY ZERO
11BAD ARGUMENT
12UNDEFINED LINE
13INVALID RETURN
14UNMATCHED LOOP
15EXPRESSION TOO DEEP
16PROGRAM ONLY
17BAD INPUT
18CONTROL STACK FULL
19LOOP VARIABLE IN USE
20GRAPHICS MODE REQUIRED
21FILL TOO COMPLEX
22FILE NOT FOUND
23BAD SAVED PROJECT
24SAVE DIRECTORY FULL
25TYPE MISMATCH
26STRING SPACE FULL
27STRING TOO LONG

If a controller seems stuck, release it, check whether the on-screen keyboard has focus, and use the app PAUSE control. A disconnected gamepad pauses the app. Text typing belongs to BASIC only while that ROM is running. Opening this host guide pauses and isolates input; close it and explicitly Resume to continue. A PDF view failure does not imply that the NES ROM is corrupt; use Help's safe Back/Close action and its local export option if available.