Syntax error
Amstrad Amstrad CPC
Severity: MinorWhat Does This Error Mean?
Syntax error on the Amstrad CPC means Locomotive BASIC could not understand the command you typed. You have misspelled a keyword, used incorrect punctuation, or written a command that does not exist in Locomotive BASIC. Type LIST to review the offending line.
Affected Models
- Amstrad CPC 464
- Amstrad CPC 664
- Amstrad CPC 6128
- Amstrad CPC Plus
- WinAPE emulator
- Arnold emulator
Common Causes
- Misspelled BASIC keyword
- Missing or mismatched quotes, brackets, or commas
- Using a command from a different BASIC dialect (e.g. Sinclair or Commodore BASIC)
- Forgetting that Locomotive BASIC requires spaces between keywords and arguments
- Accidentally pressing a key that inserted an invisible control character
How to Fix It
-
Type LIST and press ENTER to find the offending line.
Locomotive BASIC reports the line number with the error. LIST shows the line so you can spot the mistake.
-
Check for misspelled keywords.
Locomotive BASIC has some unique keywords not found in other BASICs: LOCATE (not LOCATE$), WINDOW, TAG, MODE, INK, BORDER. Make sure you are using the correct Locomotive BASIC spelling.
-
Remember that Locomotive BASIC is more strict about spaces than some other BASICs.
10 FORI=1TO10 may cause a syntax error on the CPC. Write it as 10 FOR I=1 TO 10 with spaces around keywords.
-
Retype the line with the correct syntax.
Type the line number followed by the corrected statement and press ENTER. The new version replaces the old one. For example: 10 PRINT "HELLO FROM THE CPC"
Frequently Asked Questions
What is Locomotive BASIC?
Locomotive BASIC is the built-in programming language of the Amstrad CPC, written by the company Locomotive Software. It is widely considered one of the best 8-bit BASICs — faster and more feature-rich than Sinclair BASIC and Commodore BASIC V2.
Does the Amstrad CPC support BASIC keyword abbreviations?
No. Unlike the Commodore 64 (where P followed by Shift+R types PRINT), Locomotive BASIC requires all keywords to be typed in full. However, the CPC keyboard has dedicated keys and shortcuts for common operations.