Ad Space — Top Banner

String Too Long

Apple Apple II

Severity: Minor

What Does This Error Mean?

String Too Long means a string variable exceeded the 255-character maximum that Applesoft BASIC allows. You need to shorten the string or split it across multiple variables.

Affected Models

  • Apple II
  • Apple II Plus
  • Apple IIe
  • Apple IIc
  • Apple IIgs

Common Causes

  • String concatenation (A$ = A$ + B$) producing a result longer than 255 characters
  • Reading a line from a file that exceeds 255 characters
  • Assigning a literal string longer than 255 characters

How to Fix It

  1. Check the length of your strings.

    Use LEN(A$) to print the current length of a string. If it's approaching 255, split the data across multiple string variables.

  2. Avoid building long strings through repeated concatenation.

    Loops that do A$ = A$ + X$ can quickly exceed 255 characters. Process your data in chunks instead.

  3. Split long text into an array of strings.

    DIM A$(10) and store each 255-character segment in a separate element. Process them one at a time.

Frequently Asked Questions

Why is 255 the string limit?

Applesoft (and most 8-bit BASICs) stores the string length in a single byte. A byte can hold values 0–255, so 255 characters is the natural maximum. This was considered generous in 1977 — most programs never needed strings that long.