Array Is Also Available For String Variables - Sharp MZ-80A Owner's Manual

Hide thumbs Also See for MZ-80A:
Table of Contents

Advertisement

57
Array
is also Available for String Variables
Since
an array is
available
for
numeral
variables,
there
must
be an
array
available
even
for
string
variables. Here's
an
introduction
to
what the primary array for string variables
is
all about.
Let's
generate
a
simple
program. Just
a
look
at
this. Keeping
variable
strings in the
form of
arrays
eliminates
the
labour of
writing
whenever they
are
used. The
program
itself is
neat
and simple.
10 DIM
AS (2), BS
(2),CS
(2)
20 FOR J
=
1 TO
2
:
READ AS
(J),
BS (J)
30 CS (J)
=
AS (J) + "
''
+ BS (J)
40
PRINT AS
(J),
BS (J), CS (J)
50 NEXT J
60 END
70
DATA
YOUNG,
GIRL, WHITE, ROSE
RUN
YOUNG
GIRL
YOUNG GIRL
WHITE
ROSE
WHITE ROSE
Ready

Advertisement

Table of Contents
loading

Table of Contents