ticular file. ERASE offers you some form of protection if your filespec contains wildcards in the form of a question in which you will have to answer with a Y on the keyboard to continue or with N to stop, but offers no protection if you specify a single filename, which will immediately be erased from the drive – so exercise caution! If, for example, you wanted to delete a file from drive m: called FRED.BAS, you would use:
ERASE "m:fred.bas"
If drive m: has already been set as the default drive (by either using SAVE, LOAD… or even CD), then you don't need to include the m: at the start of the filename. It doesn't hurt to include the drive anyway, and with as powerful a command as ERASE is, you might feel safer if you do. To erase all the files on drive d: you would use:
ERASE "d:*.*"
Before doing this, NextZXOS will ask for confirmation by printing
Erase d:*.* ? (Y/N)
on the bottom of the screen and assuming that you really mean to wipe all the files from the disk in drive d:, you would then type Y.
If you attempt to delete a single file (or a group of files using wildcards) while there are no files on the drive that match the filespec a File not found error will be displayed.
The dot command equivalent to ERASE is called .rm (from remove) and its syntax follows that of ERASE with the exception of two switches namely --verbose and --help.
MOVE is a very powerful command. It performs a total of five functions: moving and renaming files, changing file attributes and manually mounting and dismounting drives. Since there are separate sections for the last three functions; we'll cover only the first two here. For moving and renaming, MOVE's syntax is:
MOVE source_filespec TO destination_filespec
where source_filespec and destination_filespec follow everything discussed in the Filenames section earlier with the following considerations:
Let's examine what will happen in the first case. Assuming you have 3 NextBASIC files, named HELLO1.BAS, HELLO2.BAS and HELLO3.BAS in drive m: (in the default User Area 0) and you want to move them to User Area 1, typing as you would probably expect:
MOVE "*.bas" TO "1:"
will fail with Bad Filename, 0:1. To perform this you should actually do:
COPY "*.bas" TO "1:"
followed by
ERASE "*.bas"
In the second case (and since we now learned our lesson we won't be using wildcards) attempting to MOVE one file between drives like so:
MOVE "c:/test.bas" TO "d:/test.bas"
will fail with No rename between drives, 0:1. To perform this you should actually do like above:
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.