Chapter 3 of 7
Send a message from Moon Base
Earth has come into range. Moon Base has a two-line message ready. Can you get the CoCo to hold both lines and send them to the screen on your signal?
Give each line a number
Continue at the CoCo prompt from chapter 2. The calculations you tried there have left you with an empty program. Click the screen or press Option-Command-K. Type these two lines, pressing Return at the end of each one.
10 PRINT "THIS IS MOON BASE."
20 PRINT "CAN YOU HEAR ME?"
Where’s the reply? Look at the first thing you typed on each line. A line number tells BASIC to keep that instruction in RAM. Together the stored instructions make a program. Your words are ready in memory, waiting for the signal to start.
Send the signal
Type this command on a fresh line and press Return.
RUN
THIS IS MOON BASE.
CAN YOU HEAR ME?
OK
BASIC starts with the lowest line number. It carries out line 10, moves on to line 20, then hands the keyboard back to you at OK. The prompt is how you know this transmission is over.
Change the request
The crew has a more urgent question. Type a fresh line 20 exactly as shown and press Return.
20 PRINT "SEND SNACKS!"
How many instructions does the CoCo have now? Type this and press Return to see the stored program.
LIST
10 PRINT "THIS IS MOON BASE."
20 PRINT "SEND SNACKS!"
Count the line numbers. There are still two. BASIC used the number 20 to find the instruction you meant to replace. Line 10 was already in RAM, ready to use again.
Type RUN and press Return. Read the new transmission on your screen.
THIS IS MOON BASE.
SEND SNACKS!
OK
If the old question still appears, use LIST again. Check the number and the words on the second line. You can retype that whole numbered line, press Return, and try RUN again.
Keep the beacon handy
At the moment your beacon lives in the CoCo’s RAM. Chapter 4 will use that space for a different program. You can rebuild the beacon from the two lines shown under LIST, including the crew’s snack order. In chapter 5 you’ll give it a home on disk.
Tandy Corporation. Tandy Color Computer 3 BASIC Quick Reference Guide. 1986. Commands, pp. 2–17, particularly LIST, PRINT, and RUN.