And
the
Program Grows
It is
customary,
traditional
(and all that) to
space
the lines in a program
10 numbers
apart.
Note
that
your
two-line
program has the
numbers
10
and
20.
The reason
,
. .
it's
much easier
to modify a
program if you
leave room to insert new
lines
in-between the
old
ones.
There is
no
henefit to numbering
the lines more closely (like
1,2,3,4).
Don't do it.
Look
at
the Video
Display. Let's decide we'd
rather not have the two lines so close
together,
but
would
like to have space
between
them.
Type
in the new line:
is print
nana
Then
run
Bgjga
it
should
now read:
HELLO
THERE. I AM
YOUR
NEW TRS-80
MICROCOMPUTER!
YOU CALLED,
MASTER.
DO
YOU
HAVE
A
COMMAND?
Looks neater,
doesn't it?
But what about line 15??? It says
PRINT. PR
I NT
what???? Well
-
print nothing. That's what
followed
PRINT
,
and that's just what it printed. But
in
the
process of printing
nothing it automatically activated the
carriage return, and inserted a
space between the
printing
ordered in lines
10
and
20.
So
that's
how we
insert a space.
Another important statement is
REM,
which stands for REMARK.
It is
often convenient to
insert REMarks into a program. Why? So you or
someone
else
can refer to
them later, to
help
you
remember complicated programming details,
or even what
the
program's
for and
how
to use it. It's like having
a scratch-pad or notebook
built-in
to your program.
When you
tell
the Computer
to
execute the program by
typing
RUN
and
I3im:l
,
it will
skip right over any numbered
line which begins with the
statement
REM.
The REM
state-
ment will have no effect on the
program. Insert the
following:
5
REM *THIS IS
MY FIRST COMPUTER PROGRAM*
jiJJh
J=f;f
then
run
BZBa
The
run
should
read just
like the
last
run, totally
unaffected
by the presence
of
line
5.
Did
it?
12
Didn't that
room
'between lines 19 and
20
conte'm
handy'?
You
might
be
wondering
why
the
asterisks^) in
line #5?
The
answer
is
,
. . they're just for
decora-
tion
:
let 's give
this operation, some etwsf
Remem-
ber,
anything that is typed
on
a
line following REM
;is
ignored by the
Computer-
...