EasyManua.ls Logo

Sharp PC-1500 - Rem

Sharp PC-1500
169 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
A
ll
and more about Sharp PC-1500
at
http://www.PC-1500.info
items since
the
pattern
of
: number. cha
racter,
number is
not
immediately discernib
le.
Sometime$ it
is
desirab
le
to re.use some
or
all
of
the
values
in
the
DATA statements. The
RE
STORE
statement
allows
us
to
do
thi
s.
RESTORE
ca
us6s
S
HAR
P to
r6·
use
data
it6
ms
beginning
at
the
first
DA
TA
statement
of
the
program. Thus, any R
EA
D statements perform
ed
after
the
RESTORE will receive data items which were used
pr
eviously.
The RESTORE statement
ma
y also speci
fy
a more
se
lective "recyclin
g"
of
data i
te
ms. The
statement:
RESTORE line.number
will cause
data
items
to
be
re-assigned beginning at
th
e
DATA
statement
on
the
specified line. F
or
examp
le
:
10
DATA .8, 4
15
DATA
1,3,6,8E2
100 READ X, Y
110
READM,N,0,P
120
RESTO
RE
15
1
30
READ A , 8
When th
is
program finishes,
the
values
of
the
va
riables A and B will be 1 and
3,
respectively.
In addi
ti
on
to line numbers, DATA statements may be "labeled" with a single character.
The
RESTORE
statement
may then be used to re.issue data items beginning at the DATA s
ta
te-
ment with
the
9ivcn label.
An
example
of
a labeled DATA sta
te
ment is:
20
"
A"
:
DA
T A 1 , - 12 . 2 , 8
T
he
following program segment RESTOREs back
to
the
DATA statement labeled " X":
10
DATA
4.2,3,
1
20
"X"
: DATA - 2 . 0 .
3.
5
100
READ
0,
Y, Z
110
READ
MA,
MB
,
MC
,
MO
120
RESTORE "
X"
130 READ N, Z
At the end
of
the program N contains
-2
a
nd
Z
conta
ins
0.
S.
REM
(REMARK)
The
REM
statement provides the capability
to
in
sert comments among t
he
statements
of
a
program. Altlilough these comments are
ig
nored by SHARP,
they
are extremely important
because they assist other human
b~
in
gs
to
read
your p
rogram
. The mo
re
easi
ly
your program
is
re
ad
and
understood,
the
more
ot
he
r programmers will wish
to
u
se
it
and,
perhaps,
im
p
ro
ve it.
To
lessen
the
ty
ping burden, we ha
ve
om
itt
ed comments in this manual. We
re
commend that
you
do
NOT follow
ou
r example. Comments
are
probably most imp
orta
nt when you are printing,
saving,
or
shar
il
ng
your
programs. Do
not
rely on your mental ability to remember
what
the
meaning
of
each
variable in a program
is
, use a comment!
If
you
don't
, six
mont
hs from
now
you will have forgotten.
5 7
Do
not sale this PDF
!!!

Table of Contents

Other manuals for Sharp PC-1500

Related product manuals