NEW
10 FOR I%=32 TO 126
20 VDU I%
30 NEXT I%
40 PRINT ''
Now SAVE the program in the usual way:
SAVE "TEST"
The red light on the drive will glow for a couple of seconds, and then the BASIC
prompt ('>') will reappear. You can establish that the program was properly
saved by typing another *CAT command. This time, you will see the name
"TEST" in the list of files (they are displayed in alphabetical order) and next to it
the letters "WR". These letters tell us what operations are allowed on the file:
'W' means it may be written to and 'R' means that it may be read (i.e. loaded
into memory); we shall see later their purpose and how to alter them.
To satisfy yourself that the program has truly been SAVEd type NEW to clear
the program from memory and then:
LOAD "TEST"
Once again, the red light on the drive will glow and the BASIC prompt will
reappear. If you now type LIST you will see that the program has indeed been
copied back into memory from the disc.
It is important to understand that if you SAVE a file using a name that has
already been used, then the new file will always overwrite the old. To see this
effect, add a new line to the program in memory like this:
1 REM This is a new version of "TEST"
And then SAVE it again:
SAVE "TEST"
The previous version of the program has now been replaced with the new
version, which you may check as before if you wish. This demonstrates that
reusing an existing name always overwrites the old file, and you should bear
this in mind when choosing filenames of your own.
Directories
You can probably imagine that there are circumstances where it would be
useful to be able to reuse names when referring to files; furthermore, you would
not have to save many files before it became a chore to check whether you had
already used a particular name. For these and other reasons the ADFS
provides a very neat enhancement to file naming, in the form of directories,
which overcome these potential problems.
F 9