EasyManua.ls Logo

Commodore VIC-20 - Page 42

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...
NEXT
Format:
Abbreviation:
Screen
Display:
NEXT
[variable
,
variable
N
JfrljE
N
f"
, .
. .
,
variable]
This
statement
compleies
a
loop
that
was
started
by a
FOR
statement.
If
the
word
NEXT
is
not
followed
by a
variable
nameh
the
loop
completed
is
the
last
one
thai
was
started.
If
there
is
a
variable
name
given,
that
loop
is
finished.
If
the
loop
being
finished
wasn't
the
last
one
started,
any
loops
between
the
last
one
and
the
one
specified
in
the
NEXT
statement
are
lost.
Care must
be
taken
when
placing
loops
within
other
loops,
to
complete
them
properly.
Here
is
an
example
of
correct
placement
("nesting'*)
of
loops.
r-
EXAMPLE
1:
10
FOR
L
=
1
TO
100
20
FOR
M
=
1
TO
10
30
NEXT
M
40
NEXT
L
Notice
that
the
first
loop
finished
is
the
last
one
that
was
started.
Here
are
some
general
examples
of
the
NEXT
statement.
EXAMPLE
2:
i
NEXT
NEXT
J
NEXT
I,
J,
K
ON
Formats:
Abbreviation:
Screen
Display:
ON
variable
GOTO
number
[,
number
number]
ON
variable
GOSUB
number
[,
number
number]
This
statement
allows
the
program
to
choose
from
a
list
o1 line
numbers
to
go
to.
If
the
variable
has
a
value
of
1,
the
first
line
number
is
the
one
chosen.
If
the
value
is
2,
the
second
number
in
the
list
is
used,
and
so
on.
If
the
value
in
the
variable
is
less
than
1
or
greater
than
the
number
of
line
numbers
in
the
list,
the
program
just
26

Other manuals for Commodore VIC-20

Related product manuals