EasyManua.ls Logo

Commodore VIC-20 - Page 48

Commodore VIC-20
308 pages
Print Icon
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...
RESTORE
Format:
Abbreviation:
Screen
Display:
RESTORE
Re|:>
iiji
|s
RE
[v]
I
This
statement
sets
the
DATA
statement
pointer
back
to
the
first
DATA
statement
in
the
program.
Each
time
you
READ
the
DATA,
the
pointer
advances
through
ail
the
items
in
the
first
DATA
statement,
then
through
the items
in
the
next
DATA
statement,
and
so
on
through
all
the
DATA
statements
in
the
program.
In
order
to
re-READ
the
items,
use
the
RESTORE
statement.
EXAMPLE:
10
PRINT
"THIS
IS
THE
PROGRAM"
20
GOSUB
1000
30
PRINT
"PROGRAM
CONTINUES'1
32
I
EXAMPLE:
10
DATA
1,
2,
3,
4
20
DATA
5, 6,
7,
8
30
FOR
L
=
1
TO
6
40
READ
A
:
PRINT
A
50
NEXT
60
RESTORE
70
FOR
L=1
TO
8
SO
READ
A
:
PRINT
A
90
NEXT
RETURN
Format:
Abbreviation:
Screen
Display:
RETURN
RE^I^T
RE
']
j
This
statement
completes
a
subroutine
that
was
begun
with
the
GOSUB
statement.
When
the
GOSUB
is
performed,
the
ViC
remembers
which
line
it
came
from.
When
it
later
hits
a
RETURN
statement,
it
goes
back
to
the
statement
right
after
the
original
GOSUB.
This
is
similar
to
a
GOTO,
except
the
GOSUB
subroutine
can
be
performed
and
the
program
continued
from
the
original
GOSUB
line.
20
GOSUB
1000
I

Other manuals for Commodore VIC-20

Related product manuals