Think back a bit now.
We used semicolons
before
in PRINT
statements,
but
only
in the
middle to hook several
of them together
so they
would print
close
together on the
same
line.
In
this case,
we put a semicolon
at
the
end,
so
the
question
mark from the
next
line
wil print on the
same line,
rather
than down
there
by itself. After
changing line
5
as
above,
RUN it. It should read:
THE
VALUE
I WISH
TO
GIVE A
IS?_
Please note
that you cannot use
a
semicolon
indiscriminately
at the
end of a
PRINT
state-
ment.
It
is
only meant
to hook two lines together,
both
of
which have
printing to be
done.
The
INPUT line prints
the question mark.
We shall
see later
where two long lines starting
with PRINT can
be connected together
by
the
trailing semicolon
so as to print
on
the same
line.
Your
Radio
Shack TRS-80
Interpreter
is,
as
has
been
mentioned,
able
to speak "The
King's
Basic" as well as a variety
of dialects.
The
first of the
many
"short-cut"
dialects we
will be
exploring
throughout these
lessons
involves
combining
PRINT
and
INPUT
into
one state-
ment. Change line 5
to
read:
5
INPUT
"
THE
VALUE
I WISH
TO
GIVE A IS"
*,
A
then delete line
10
by typing
10
then RUN.
The
results come
out
exactly
the same, don't they? Here
is
what
you have changed:
1. PRINT to INPUT
2.
Both statements
on the same
line
3. Eliminated
the extra line
In the
long
programs which you will be writing, running and
converting,
this shortcut
will
be valuable.
Up to
now,
all our programs have
been
strictly
one-shot
affairs. You
type RUN
,
the
Computer
executes the program,
prints the results (if any) and
comes
back with a
READY
,
To repeat the program, you have to type
in RUN again. Can
you think
of
another
way
to
get the Computer to execute
a
program
two or more times?
34
teterttreter
—
is
the internal
circuit
that
allows
you
t&
"tallr"
to tb»$R&dD
In
English
(BASIC) and
P--
it
can talk to
you.
Sometimes
the
word
dialect
is
used
when talking
about
the
different
forms
of a computer
language,
Jfust
as
with
dialects ha
"human"
Sanguages,
there
..,
can
be slight differences
in
word uses, etc.
in
BASIC.
(Radio
Shack's BASIC
is totally
com-
;
-
;
patibie
with the
Dartmouth BASIC
—
the Original
BASIC. But
we
do have some handy
short
cuts,
so
we
might
etui
them
a
"dialect",)
Well
some-
times
reler
to this
as a shortcut
and
sometimes
as?
a dialect.
N$
—
don't enlarge the program by repeating
its u
ste^s over and
oser again
—
that's not very
.creative!-
;:
^,V