Chapter
3
SAMPLE SESSION
The easiest way
to
learn how BASIC operates is
to
write and run
a program. This chapter provides sample statements and instruc-
tions
to
help familiarize you with the way BASIC works.
The main steps in running
a
program are:
1.
Loading BASIC
2.
Typing the program
3.
Running the program
4.
Saving the program
5.
Loading the program into memory
Loading
BASIC
For
this sample, load BASIC by typing:
BASIC
[ENTER)
Typing
the
Program
Type in the sample program below. After typing each line, check
it for any mistakes. If there are no mistakes, press
I.
If you
make
a
mistake, use the
[tl
key
to
move the cursor
to
the
mis-
take and retype the rest
of
the line
to
correct the mistake.
10
A$=”WILLIAM SHAKESPEARE WROTE
15
B$=”THE MERCHANT
OF
VENICE”
[*F
20
PRINT A$;
B$
[ENTERJ
Check your program again. If you find a mistake, enter the line
number and type the line again. The newly typed line replaces
the old line.
It
does not matter
if
you enter Line
15
after Line 20; BASIC still
reads and executes Line
15
before “looking” at Line 20. BASIC
always reads program lines in numerical order.
Tell BASIC
to
execute this program by typing:
RUN
[ENTER]
Your screen should display:
WILLIAM
SHAKESPEARE WROTE THE MERCHANT
OF
VENICE
27