980M free
before we discuss what has happened, make a small modification to the program (for example add an exclamation mark after World on line 10 and do another save, a bit different this time:
SAVE "hello"
and follow it by CAT "hello*.*" . Now you'll see:
hello 1K
hello.bas 1K
hello.bas.bak 1K
980M free
Repeat the last save command one more time and then do CAT "hello*.*" again. The screen now shows:
hello 1K
hello.bak 1K
hello.bas 1K
hello.bas.bak 1K
980M free
If you however, had started with a SAVE "m:" thus redirecting the default drive to the RAMdisk, everything would have been a bit different. First by not displaying a hello.bas.bak and now after the entire series of commands CAT would have returned:
HELLO 1K
HELLO.BAK 1K
HELLO.BAS 1K
59K free
so, why the difference? Let's take it from the beginning. We initially saved a NextBASIC program that was named hello.bas; then once we saved it again, the file with the same name on the drive had a .bak type appended to it. Then we saved the same program with a name without a type. In the second case since we were trying to save to a +3DOS filesystem (the RAMdisk), NextZXOS can only use 8+3 character filenames unlike the FAT filesystem that can have very long filenames. So in the second case, instead of appending the .bak type to the original hello.bas file, it stripped the .bas type and replaced it with .bak. What followed is, that we tried to save the same name without type but now NextZXOS had a decision to make; which filename with .bak type to keep? As you could easily find out by LOADing back the hello.bak file, the last version saved is the one retained. Your PRINT statement would be the one with the exclamation mark and not the one without.
This example, makes an important point that due to the disparate types of filesystems NextZXOS can handle, the auto backup feature provided is nice but it's not a panacea, so do not rely on it exclusively and instead name your files explicitly!
A slight variation of the SAVE command as it deals with NextBASIC programs is that you can add the LINE modifier with either a numerical parameter or a label name after it. For example saving the program above with:
SAVE "hello.bas" LINE 10
and then doing
LOAD "hello.bas"
ZX Spectrum Next User Manual, 3rd Edition (ISBN 978-1-5272-5496-1), written and illustrated by Phoebus R. Dokos. Copyright © 2020-2024 Phoebus Dokos / SpecNext Ltd. Licensed under CC BY-NC-SA 4.0. This is a transcription and can contain errors; check any doubt against the printed page.