8.3 · Lesson 1 of 1

File handling

Syllabus 8.3.1Syllabus 8.3.2

What this lesson covers

  • Explain why data is stored in files
  • Open, read, write and close files

Key vocabulary

File
A collection of data stored in secondary storage, kept after the program ends.
OPENFILE
Opens a file FOR READ or FOR WRITE.
READFILE
Reads the next line of a file into a variable.
WRITEFILE
Writes a value to a file as a new line.
CLOSEFILE
Closes a file when the program has finished with it.
File mode
How a file is opened: READ to read from it, WRITE to write to it.

Check your learning

  • Quick check: 4 questions
  • Key vocabulary test: 6 terms
  • Activity 1: File handling · 5 questions
  • Activity 2: File handling quiz · 7 questions
  • Activity 3: Writing to a file · drag and drop
Loading Bits of Bytes…