?FILE DATA ERROR

Commodore Commodore 64

Severity: Minor

What it means

The C64 shows ?FILE DATA ERROR when a program reads text from an open file where it expected a number.
Commodore's C64 manual describes it this way: string data was received from an open file, but the program was expecting numeric data.
Typing letters at the keyboard during an INPUT gives ?REDO FROM START instead.

Affected Models

  • Commodore 64
  • Commodore 64C
  • Commodore 128 in C64 mode

How to Fix It

  1. Check the order of the items in the file against the order the program reads them.

  2. Read the item into a string variable such as A$ first, and use VAL(A$) if you need the number.

Frequently Asked Questions

Why does the C64 manual call it BAD DATA?

The C64 User Manual and the Programmer's Reference Guide list this error under the name BAD DATA.
The message stored in the C64's own ROM reads FILE DATA, and that is what appears on screen.
Commodore's C128 guide uses the FILE DATA name: bad data read from a tape or disk file.