EasyManua.ls Logo

Atari 800

Atari 800
326 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...
NEXT
(N.)
Atari
BASIC
Reference Guide
141
CONFIGURA
TION
NEW
EXAMPLE
NEW
The
NEXT
statement
is
used
with
a FOR statement
to
form
a
repetitive
section
of
a
program
.
CONFIGURATION
NEXT
X
A
FOR
statement begins a
loop
, and a
NEXT
statement ends it.
The FOR statement
sets
an
initial value and a final value
for
the
counter.
The
optional
STEP
statement specifies
the
amount
that
the
counter
is
increased
or
decreased each
time
the
loop
is
executed.
EXAMPLE
10
FOR
I = 1
TO
10
STEP
2
20
PRINT I
30
NEXT
I
In
the previous example, the variable I
is
the
co
unter.
The
initial
value
of
the
counter
is
1,
and the final value
is
10.
The value
of
the
counter
is
increment
ed by 2 each
time
the
loop
is
executed.
The section
of
the
program
between
the
FOR and
NEXT
statements
is
repeated
for
each
different
value
of
the
counter
.
Each
time
the
NEXT
statement
is
executed,
the
value
of
the
counter
is
changed by
the
STEP
argument
value. The
loop
is
repeated
for
each value
of
the
counter.
In the previous example,
the
loop
is
repeated 5 times,
with
the
counter
equal
to
1,
3,
5,
7,
and
9.
The initial value
of
the
counter
(I)
is
1, and
it
is
increased by
2 each ti me
the
loop
is
executed because
of
the
STEP
2 statement.

Other manuals for Atari 800

Related product manuals