Skip to content
Game 0 Unit 3 of 15 1 hr learning time

PRINT, Properly

Give PRINT its punctuation — join text and numbers with a semicolon, line them up in columns with a comma, break a line with an apostrophe — then clear the screen with CLS and start the title card you'll grow all primer.

20% of Meet BASIC

You met PRINT in Unit 1. On its own it shows a word. With punctuation, it lays text and numbers out — joined, spaced, or broken onto new lines. Three marks do most of the work: the semicolon, the comma, and the apostrophe.

Milestone 1 — join with a semicolon

A semicolon joins two things with no gap between them:

  10 PRINT "Score: "; 100

RUN it: Score: 100. The text "Score: " and the number 100 print as one run, the semicolon butting them together. The space after the colon is inside the quotes — the semicolon adds none of its own.

The Spectrum screen showing Score: 100, with the report 0 OK, 10:1.
A semicolon joins text and a number into one line, with no gap of its own — the space comes from inside the quotes.

Milestone 2 — columns and new lines

The comma and the apostrophe place things differently. Add two more lines:

Step 2: a comma and an apostrophe
+2
11 10 PRINT "Score: "; 100
2+ 20 PRINT "Left", "Right"
3+ 30 PRINT "Top" ' "Bottom"
24

The comma jumps to the next column zone — the screen has two, at the left edge and halfway across — so Left and Right line up in columns. The apostrophe starts a new line, so Top and Bottom print one above the other from a single PRINT.

The Spectrum screen showing Score: 100, then Left and Right in two columns, then Top and Bottom on separate lines.
Semicolon joins, comma tabs to the next column zone, apostrophe breaks to a new line — three marks, three layouts.

Milestone 3 — clear the screen, start the title card

CLS clears the screen before you print, so each run starts on a clean slate. We'll use it to open a title card — a small splash screen we grow across the primer until it has colour, sound, and motion. Here's its first, plain version:

  10 CLS
  20 PRINT "MEET BASIC"
  30 PRINT "a Spectrum primer"
The Spectrum screen showing MEET BASIC on one line and a Spectrum primer below, on an otherwise clear screen.
The title card, version one: CLS for a clean screen, then two lines of text. By the end of the primer it will have a place, a palette, a fanfare, and movement.

When it doesn't work

  • The two things printed on top of each other, or ran together oddly. Check which separator you used — ; joins with no gap, , jumps a column, ' starts a new line.
  • Old text is still on screen under the new. No CLS. Each RUN prints over whatever was there; CLS wipes it first.
  • Nonsense in BASIC. A missing quote, or a separator where a value should be. List the line the report names and read the punctuation carefully.

Before and after

You started with PRINT showing one word and finished laying text and numbers out three ways — joined, columned, and stacked — then cleared the screen and began the title card. The idea underneath: PRINT's punctuation places things; CLS gives you a clean slate. You'll lean on both in every screen you build.

Try this

  • Build a line. Print a name and a score together: PRINT "Lives: "; 3.
  • Mix the marks. One PRINT with a comma and an apostrophe — predict the layout, then run it.
  • Forget the CLS. Run the title card twice without line 10. Watch it pile up, then put CLS back.

What you've learnt

  • ; joins with no gap, , tabs to the next column zone, ' starts a new line.
  • A PRINT can mix text and numbers in one statement.
  • CLS clears the screen so each run starts clean.
  • The title card begins here — a splash screen we'll grow as the primer goes on.

What's next

So far the screen only shows what you typed into the program. In Unit 4 we give the program a memory: LET, the named box that holds a value — and the Spectrum's own rules about what you may call one.