Ad Space — Top Banner

?UL ERROR

Dragon Data Dragon 32/64

Severity: Minor

What Does This Error Mean?

?UL ERROR means Undefined Line Number — a GOTO, GOSUB, or THEN/ELSE points to a line that does not exist in the program. Type LIST to see all existing line numbers, then correct the branch to point to a valid line.

Affected Models

  • Dragon 32
  • Dragon 64
  • Dragon 200E
  • XRoar emulator

Common Causes

  • Typing a GOTO or GOSUB with a line number that was never written
  • Accidentally deleting the target line
  • Renumbering lines without updating GOTO/GOSUB references
  • Typo in the line number (e.g. GOTO 100 when the line is 1000)

How to Fix It

  1. Note the line number shown in the error message.

    BASIC prints the line of the GOTO/GOSUB that has the bad reference. For example: ?UL ERROR IN 50 means line 50 has a branch to a nonexistent line.

  2. Type LIST to see all line numbers in the program.

    LIST prints every line. Look for the target line number that the GOTO references — if it is absent, that is the problem.

  3. Correct the GOTO or GOSUB to point to an existing line.

    Type the line number of the GOTO followed by the corrected statement. Example: if line 50 says GOTO 200 but line 200 does not exist, change it: 50 GOTO 210 (or wherever the target routine starts).

  4. If you renumbered lines, update all GOTO and GOSUB references manually.

    Dragon BASIC does not have an automatic RENUM command that updates references. After renumbering, you must manually find and update every GOTO, GOSUB, THEN, and ELSE that uses a line number.

Frequently Asked Questions

Does the Dragon have a RENUM command?

The Dragon 64 with Dragon DOS has a RENUM command that renumbers lines, but it does not always update GOTO/GOSUB references automatically. Always check all branch statements after renumbering.

Why do Dragon BASIC programs often use line numbers like 10, 20, 30?

Spacing lines in tens leaves room to insert new lines between existing ones (e.g. line 15 between 10 and 20). This was the standard practice in the 8-bit era before structured programming tools were available.