Radio Shack TRS-80 Model 100 Basic Manual page 11

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

Advertisement

PRINT "JOHN SMITH"
JOHN
SI'1
I TH
Ok
Use the PRINT command to print your own name if you haven't already done so.
Also, try printing other phrases. For example, to print How now brown cow, type:
PR I NT
II
HOW NOW BROWN COW
II
(ENTER)
Notice that the phrase is printed exactly as it appears within the quotation marks,
including spaces.
Experiment #2 What is a BASIC Program?
A BASIC program is a list of instructions (or statements) that the Computer
executes, one at a time, in a sequential order. An instruction differs from a command
in that it is preceded by a line number.
Here is a simple BASIC program:
10 PRINT "JOHN SMITH"
This program, consisting of only one statement, the PRINT statement, accomplishes
the same thing as the command:
PRINT "JOHN SMITH"
CENnID
But because the word PRINT is being used in a program and preceded by a line
number, it is now called a statement. The number H'J which is typed before the PRINT
statement is called a line number. Every line in a BASIC program must have a line
number, even
if
the program contains only a single line.
Type line 10 as it appears above. Notice that nothing happens this time when you
press
(ENTER).
Unlike a command, which instructs the Computer to perform a task
immediately, a program does nothing until the Computer is instructed to execute it.
This is accomplished with the command:
RUN
Type the RUN command. Don't forget to press
(ENTER)
after typing it.
After entering the RUN command, the program is executed and the name is displayed.
5

Advertisement

Table of Contents
loading

Table of Contents