Dr Logo for the Tatung Einstein, showing a rosette drawn by the turtle
← Back to Courses
module
11

Keeping your work

Introduction

Everything you have defined so far lives in the machine's memory and nowhere else. Switch it off and it is gone - not damaged, not recoverable, simply not there any more.

This section is how you stop that happening.

Saving

save "shapes

That writes everything you have defined - every procedure in the workspace, not just the last one - onto the disc, under the name shapes.

It goes on the same disc Dr Logo came from. There is plenty of room: Dr Logo and the two programs that came with it take about a third of it, and the other 128K is yours.

If it works, nothing is printed at all. Dr Logo is quiet when things go right.

To see what is there:

dir

which answers with a list of names.

Getting it back

Next time you start the machine:

load "shapes

and every procedure in that file is defined again, ready to use. The machine tells you what it has learned as it goes.

load adds to what is already there. It does not clear the workspace first. If you have star defined and load a file that has a different star in it, the one from the file wins - but anything the file does not mention is left exactly as it was. That is usually what you want and occasionally very confusing.

Saving over something

Dr Logo will not overwrite a file. Save under a name that is already there and it says so:

?save "shapes
File shapes already exists

Nothing is written, and the old file is untouched. To replace it, take the old one away first:

erasefile "shapes
save "shapes

You will hit this the second time you save. It is not a mistake on your part and there is no option to force it - erase, then save.

The code

Starting from

A fresh boot, at the ? prompt.

What you should see

star defined when the definition closes, nothing at all from the save, and then the listing:

[QUIZ SKETCH SHAPES]

SHAPES is yours. QUIZ and SKETCH were already on the disc - they are the two programs Tatung shipped with Dr Logo in 1984, and Appendix II says what they are. Leave them alone and they will not get in your way.

A procedure defined, saved to the work disc, and listed

The name comes back in capitals. That is how the disc stores it, and load "shapes in lower case will still find it.

Now switch the machine off. Start it again, type load "shapes, then star. That is the whole point of this section.

Change one thing

  • Run the last two lines again - save "shapes a second time. Read what it says, then get the save to work without changing the name.
  • Type erall, then star. Then load "shapes and star again. What did erall do, and what brought it back?
  • Type po "star before you save, and again after a load. Is what comes back identical to what you typed in?

When it goes wrong

Symptom Cause
File shapes already exists Dr Logo will not overwrite. erasefile "shapes first.
File shapes not found Nothing of that name on the disc. Check with dir.
No Drive 1: and every key you press gives it again You have typed b: in front of a name, asking for a second disc drive that is not there. Close the emulator and start it again. Anything unsaved is lost.
Disk is full The disc has no room left. erasefile something you no longer want.
Everything came back except one procedure load only defines what is in the file. Something you defined after the last save was never saved.

Summary

save "name writes your whole workspace to the disc and load "name brings it back, including after the machine has been off. dir lists what is there. Dr Logo refuses to overwrite, so erasefile first. Save often.

If you would rather keep Dr Logo's disc pristine, the machine has a second drive: start MAME with a second -flop2 somedisc.mfi and put b: in front of every name - save "b:shapes, dir "b:. It is not necessary and the course does not use it.

Next

S12, giving a procedure a number - one square that can draw any size, instead of one for every size you want.

Get the Newsletter

New guides, disk images and community finds, roughly once a quarter. No spam, we promise, this isn't Tatung's marketing department.
Your subscription could not be saved. Please try again.
Your subscription has been successful.

Newsletter

Subscribe to our newsletter and stay updated.