EasyManua.ls Logo

Laser 128 - Page 131

Laser 128
255 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...
BASIC COMMANDS AND STATEMENTS
3.14
FOR
.
..
NEXT
Purpose:
Loops a
round
a
group
of
instructions
a
specified
number
of
times.
Format:
FOR
variable
= n
TO
m
[STEP
i]
NEXT
[variable]
[.variable]
...
Comments:
The
variable
-
which
is
optional
with
the
NEXT
-
acts
as a
counter
for
the
number
of
times
the
instructions
within
the
loop
surrounded
by
the
FOR
and
NEXT
are
executed.
n is
the
initial
value
of
the
counter,
m
is
the
final
value
of
the
counter,
and
i
is
the
step
or
increment.
All
the
instructions
in
the
l
oop
are
executed
down
to
the
NEXT.
Then
the
counter
is
increm
e
nted
by
i.
(If
you
do
not
give
a
value
for
i,
the
BASIC
interpreter
assumes
i is
one.)
Then
a c
he
ck
to
see
whether
the
value
of
the
counter
is
greater
than
m
follows
.
If
it
is
not,
the
loop is
gone
through
again.
If
it
is
greater
than
m,
then
the
program
continues
with
the
instructions
that
follow
the
NEXT
statement.
11-40

Table of Contents