EasyManuals Logo
Home>Atari>Desktop>XL

Atari XL User Manual

Atari XL
262 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
Page #42 background imageLoading...
Page #42 background image
32
The
Ateri
XL
Handbook
specified
using
the
command
STE
P.
Try
changing
line
10 to:
10
FOR
COUNT
= 0
TO
30 STEP 3
Then
RUN
the
program
again.
COUNT
is
now
increased
by
3
each
time
the
loop is
repeated.
The
STEP
can
also be
negative,
so
that
the
numbers
get
smaller:
10
FOR
COUNT
= 50
TO
0 STEP
-2.5
In
summary,
the
instructions
are
used
like
this:
FOR
V = X
TO
Y STEP Z
is
used
to
begin
a loop (V
is
a
variable
and
X, Y
and
Z
may
be
variables
or
numbers),
and
NEXT
V
marks
the
end
of
the
loop.
Note
that,
unlike
some
other
microcomputer
BASICs,
in
Atari
BASIC
the
variable
must
be
specified
after
NEXT.
The
variables
used
in
FOR
...
NEXT
loops
must
be
simple
numeric
variables;
string
variables,
and
elements
of
arrays
may
not
be
used.
Nested
Loops
FOR
...
NEXT
loops
can
be
nested
-
that
is,
one
loop
can
be
contain
one
or
more
other
loops.
Here
is
an
example:
10
FOR
A = 1 TO 3
20
FOR
B = 1 TO 4
30
PRINT
A,
B
40
NEXT
B

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Atari XL and is the answer not in the manual?

Atari XL Specifications

General IconGeneral
BrandAtari
ModelXL
CategoryDesktop
LanguageEnglish

Related product manuals