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

06 NES BASIC PROGRAMMING GUIDE

Input and output

PRINT accepts numeric/string expressions and literal text. A semicolon places the next value immediately after the previous one. A comma advances to the next four-column tab stop. With no trailing separator, PRINT ends its output line. A trailing separator leaves the output position for the next PRINT. Comma is a formatting separator here; do not assume another BASIC dialect's larger zones.

PRINT "VALUE=";A prints the label and the number together. PRINT A;" ";A$ prints the independent numeric and string values with a space. These are direct fragments rather than complete stored programs. PRINT output has a bounded buffer; OUTPUT TOO LONG is recoverable.

INPUT accepts a numeric variable or a string variable, with an optional prompt expression and semicolon: INPUT "AGE";A or INPUT "NAME";N$. The cartridge adds its question marker. Numeric input must be a valid signed integer; an empty or invalid answer raises BAD INPUT and retries. String input preserves spaces and accepts empty input; overlong or pool-full entries retry without changing the old destination. B/Backspace edits the answer. Ctrl+C or the emergency pad gesture cancels and recovers.

LOCATE column,row positions text output at column 0–27, row 0–21. CLS clears the active text terminal or graphics canvas. PRINT, INPUT and LOCATE restore text when used from graphics, so they can remove a graphics image. Keep a program's graphics section and text reporting section distinct when that matters.

INKEY$ reads one newly queued input event without waiting; INPUT collects an edited whole answer and can wait. They serve different jobs. A loop using INKEY$ must test for an empty result before calling ASC. The input-code project in Chapter 11 shows the pattern.