Download Print this page

RETRO The Spectrum User Manual page 51

Advertisement

Whenever you save a BASIC program The Spectrum will write to a new file on the
USB stick based on the name you give to the SAVE command. If that filename already
exists, it will add an incremental suffix to guarantee uniqueness. This new file will be
used for subsequent saves until the next BASIC program is saved (or another action
overrides the save filename, discussed later in this chapter).
There are cases where data arrays and bytes are saved without having first saved
a BASIC program to cassette tape. This may be because a game has saved some
high-score data, or perhaps you are using a database program and have saved the
new contact details you have entered. In these scenarios The Spectrum applies some
additional strategies to determine which filename to write to the USB stick.
If you have an attached tape file that is not writable (in other words it does not have
a _WR suffix) then The Spectrum will use that tape filename as a basis for any files it
creates during saving if it has first not saved a BASIC program.
For example, imagine having the tape file my-game.tap attached through Media
select, and then some data saved as follows
SAVE "scr" CODE 16384,6912
Since no BASIC program has yet been saved, The Spectrum will instead use the
filename of the attached tape file, appending to it the _WR suffix and saving the data
to the resulting file named my-game_WR.tap.
This means that saved data will be written to a cassette tape file named after the program
that is attached and running, so that it relates to that program and is easy to find. The
same dynamic indexing of filenames will be applied, such that if my-game_WR.tap
already exists from a previous save then my-game-1_WR.tap will be created instead,
and so on.
The filename my-game_WR.tap will continue to be used for saving until a BASIC
program is saved or the attached tape file is ejected or exchanged.
There is a small corner case where data may be saved without first saving a BASIC
program or attaching a tape file though Media select. In this situation The Spectrum
falls back to a default filename of TheSpectrum_WR.tap, again with an incremental
suffix when that filename already exists.
You can see this in action if you eject any tape that is attached in Media select and
choose Reset the machine to clear The Spectrum's memory. Then save some data
before saving anything else:
SAVE "scr" CODE 16384,6912
Saving programs and data
51

Advertisement

loading
Need help?

Need help?

Do you have a question about the The Spectrum and is the answer not in the manual?