Radio Shack TRS-80 User Manual page 90

Micro computer system
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

Line 30
READ A
as
1,
but
line
35
immediately
RESTOREd
the
DATA
LINE
TO
ITS
ORIGINAL
UNREAD
CONDITION. When
the
FOR-NEXT
loop brought
the
READ
line
around
for the
next
pass
it
again read the
first
piece of data,
which was
that
same
1.
Same
thing
with
all
successive passes.
READ
and
DATA
statements
are
extremely
common.
The
RESTORE
statement
is
used
less
often.
String Variables
Who
knows
where
some
of these
seemingly
unrelated
words
come
from?
If
they weren't so
important
we
could
ignore
them.
We
have been
using the
letters
A
through Z
to indicate
numbers.
They
are called
NUMERIC
VARIABLES.
In
LEVEL
I
BASIC we
have
set
aside
2
additional
symbols
to indicate
STRING VARIABLES.
They
are
A$, and
B$,
pronounced
"A
String"
and
"B
String". String variables
can be assigned
to indicate Letters,
Words
and/or Combinations of
letters,
numbers and
spaces
of
up
to
16
characters.
Type
NEW
,
then type
in:
10
INPUT
"WHAT
IS
YDUR
NAME";AS
20
PRINT "HELLO
THERE,
";A$
.
.
.
and
RUN.
Hey-hey!
How's
that for a
grabber?
If
that,
along
with
what you
have
learned
in
earlier
chapters doesn't
make
the
creative juices
flow,
nothing
will.
That's
Two
Two
ways
we
now know
to
print
words.
The
first,
learned long ago,
is
to
imbed words
in
PRINT
statements (and
is
called
"printing a
string").
The
second
is
to bring
in
a word(s)
through an
INPUT
statement
(called
"inputting a
string").
If
you
can't
think
of
the
third
way,
go
back and check
the
title
heading
at
the
first
of
this
chapter.
Ah
yes,
brilliant
student!
Ahem
.
.
.
(Reading
a
string.)
Change
the
program
to
read
:
10
READ
A$
20
DATA RADIO SHACK TRS-80
30
PRINT "SEE MY
FOXY"(A$
88

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents