Saving to other locations on the Pico

When I write a program, using EDIT on my PicoCalc and save using F1 the file goes to a memory location 1. I believe the Pico has 8 of these locations. How do I save my program to one of the other locations (2-8)?
If I create a Games and Music folder on the SD card and add either games or music to them, how do I access them on the PicoCalc to pay either a game or music?

The SD card is the B: drive. So just

Save "b:myprog

The .bas and closing quote is not required.

You can also set the default drive by doing

Drive b:

Then you can

save "myprog

and it will go to drive b: (SD card).

The A: drive is the flash drive on the Pico. Note that this is different from the 8 flash slots.

To get a list of files

files

to get a list of files on the current drive or

files "a:
files "b:

to get a list of files for a specific drive.

So I can/cannot save more than one file to a: .

No. You can save several tiles to A: But it’s a smaller storage area than B: and not removable (i.e. harder to back up).

Hmm, I thought in addition to the file-system on A:/ the PicoMite ony had 4 flash slots (0 .. 3) and that 0 was reserved for the “current program”.

Assuming my memory isn’t failing me:

When you LOAD "file.bas" or RUN "file.bas" a program, it is tokenized and copied into flash slot 0 from which it can be executed … flash slot 0 always contains the program being executed.

When you EDIT (without specifying a filename) you are editing the program in flash slot 0. Even if you loaded or ran it from a file when you exit/save from the editor it DOES NOT update the contents of the file. You must do an explicit SAVE "file.bas" … this will drive you batty because you will lose work ! :wink: .

If you do EDIT "file.bas" then I believe you ARE editing the file on disk … but if you then type RUN without explicitly specifying the file you will run the copy still in flash … this will drive you batty!

There are reasons, both real, imagined and historical for this eccentricity, just don’t expect me to explain them.

One way to save your sanity is (I believe, test it for yourself) to start your program with SAVE "A:/path/to/file.bas" which will automatically save the contents of the current program over the given file when it is RUN.

Best wishes,

Tom

You may be correct on that. I haven’t fully read up on that yet.

What I do know is that there are basically 3 locations you can save stuff to.

  1. The A: drive - which is a flash drive on the Pico. Save “a:prog.bas”
  2. The B: drive - which is the SD card. Save “b:prog.bas”
  3. One of the flash “slots”. “flash save 1”

I haven’t tried this, but I would not expect this to be the case. I would assume that the editor would run, load the program into memory and let you edit it. You would still need to SAVE it to keep it around. And anything in the editor would be wiped as the new program is loaded in.

Otherwise EDIT “B:PROG.BAS” would probably not work.

I haven’t tried this, but I would not expect this to be the case. I would assume that the editor would run, load the program into memory and let you edit it. You would still need to SAVE it to keep it around. And anything in the editor would be wiped as the new program is loaded in.

Otherwise EDIT “B:PROG.BAS” would probably not work.

I think not, but I’ve been wrong before :wink: .

When you EDIT, the contents of flash 0 is detokenized* into RAM. When you exit the editor (and don’t abandon changes) it is retokenized back into flash 0.

* It is this detokenization that “messes” with the capitalisation of keywords and can even change some keywords to their canonical form, e.g. CAT used to be converted to INC, I don’t know if it still is.

When you EDIT "filename.bas", the contents of the file is copied (no detokenization necessary) into RAM. When you exit the editor (and don’t abandon changes) it is copied back into the original file.

Best wishes,

Tom

There is room for many files on drive A: (more on Pico 2 than Pico) They are separate from the four memory slots used for LIBRARY files. SAVE “filename” will save to the default drive which is normally A: but you can make drive B: (SD card) be the default drive if you want with the command
DRIVE “B:”