Appendix A
Your field guide
Come here if you remember what you wanted to do but have forgotten what BASIC calls it.
Find a command
| When you want to… | Use | Try it in |
|---|---|---|
| Put words or a number on screen | PRINT |
Give one instruction |
| See the program in memory | LIST |
Moon Base |
| Start the program again | RUN |
Moon Base |
| Wait for one key | INKEY$ inside the program |
Pick a planet |
| Ask for a number and wait for Return | INPUT inside the program |
The crew quiz |
| Make a choice | IF and THEN |
The crew quiz |
| Count trips through a loop | FOR and NEXT |
Catch the computer |
| Find files on the CoCo disk | DIR |
Tomorrow’s message |
| Keep the program or bring it back | SAVE or LOAD |
Tomorrow’s message |
| Clear the program in RAM | NEW, after saving |
Tomorrow’s message |
When the screen surprises you
Typing goes nowhere. Look at the main emulator window. If the toolbar offers Run, the CoCo is paused. Resume it, then choose Input → Focus CoCo Display. If the BASIC editor is stopped at a breakpoint, use Continue there to keep your place in the program.
The planet menu waits; the quiz shows a question mark. The planet program watches for one key. Press 1 or 2. The quiz uses INPUT. Type a number and press Return so BASIC knows your answer is finished.
BASIC reports a syntax error. Compare the spelling, the quotes, and the number at the start of the line with the listing. Retype the whole numbered line. Run the program again. At the prompt, an instruction without a number takes effect as soon as you press Return.
The disk seems empty. Check that the selected profile is Disk BASIC and that FD0 shows your practice disk’s Mac filename. Use DIR to see the names inside it. A new disk image and a copy of the initialized starter disk are different things. These lessons use a copy. Go back to the safe copy steps before writing.
The screen says ?WP ERROR. Stop before clearing RAM. Check the practice disk’s name and write protection in Floppy Disks. The program you tried to save is still in RAM. Fix the destination and try the save again.
Files you can open
Reading in Help → Manual Library…? Click a filename to open an editable BASIC example beside the book. If you’re reading in a browser, save the file to your Mac and choose Open… in Develop → BASIC Development. BASIC’s LOAD command on the green screen looks inside the mounted CoCo disk.
- BEACON.bas — the first two lines from Moon Base.
- planet.bas — the two-color Earth or Mars starter.
- SIGNAL.bas — the three-blink counter.
- QUIZ.bas — the completed crew quiz with its original title.
Words from the workbench
Input is information going in, like the key you pressed. Output is information coming out, like the greeting you saw. A prompt is a sign the computer is ready for you.
An instruction tells a computer to do something. A program gives it a set of instructions to follow. The CPU, or central processing unit, carries out machine instructions. The interpreter is the program that understands your BASIC and directs the work.
RAM is read/write working memory. Your beacon lived there while you edited it. ROM is read-only memory. It holds built-in software, including the interpreter that understands PRINT. A bit holds one of two values. Eight bits make a byte.
A file is a named collection of data you can come back to. A CoCo disk drive reads and writes files on a disk. VCC Plus puts the contents of a whole disk in a disk image, one file on the Mac.
A variable has a name and holds a value. A loop repeats instructions. A breakpoint tells the debugger to pause before a chosen line runs. The debugger’s watch shows a variable’s value while the program is stopped.