Radio Shack TRS-80 Model 100 Basic Manual page 19

Basic language lab
Hide thumbs Also See for TRS-80 Model 100:
Table of Contents

Advertisement

Experiment #4 Writing Your Own Programs
By now you should be able to write simple BASIC programs using the two
instructions PRINT and GOTO.
Before you go on experimenting with the spacing in PRINT statements using the
comma and the semicolon, you should be aware of another useful command, the
NEW command.
When you enter the NEW command, any program that has been previously typed and
is currently residing in working memory will be erased automatically.
Before you begin typing in a new program, you should always use the NEW
command to clear out the old program. Otherwise, you may end -up with a
combination of your new and old programs.
Assume that your old program still resides in memory:
10 PRINT "HOW"; "NOW";
is
PRINT "SPLENDID ";
20 PRINT "BROWN "; "COW"
Now, without deleting this program, enter the following new program:
10 PRINT "MY COMPUTER IS A ";
20 PRINT "TOOL."
If
you list the program, you will find it is:
LIST
10 PRINT "MY COMPUTER IS A ";
15 PRINT "SPLENDID ";
20 PRINT "TOOL."
K
Note that line 15 still exists because that line number was not used in the new
program. So remember, before typing a new program, clear the memory with the
command NEW. This won't be necessary, however, if you are certain that no program
exists in memory.
What you have learned:
In this lesson you have learned some commands to write and execute a simple BASIC
program. The PRINT and GOTO statements have been used to display simple
messages. Editing a BASIC program can be
accompli~hed
by retyping existing
line~
or
typing new lines. The NEW command is used to delete an entire program from
memory.
13

Advertisement

Table of Contents
loading

Table of Contents