EasyManua.ls Logo

Atari XL

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
Loading...
38
The
Atari
XL
Handbook
which
they
were
typed
in.
Again,
a R ...
loop is
used.
The
lines
from
210
to
280
sort
the
numbers
in
the
array
SORT(IO)
into
ascending
order.
A
FOR
...
NEXT
loop
compares
each
element
of
the
array
SORT
with
the
next,
and
swaps
them
over
if
they
are
in
the
wrong
order.
A
variable,
COUNT,
keeps
track
of
the
number
of
these
swaps
and,
if
at
the
end
of
the
loop
this
isn't
zero,
the
loop is
repeated.
Lines
310
to
330
complete
the
program
by
PRINTing
the
two
sets
of
numbers.
PAUSES
To
make
a
pause
during
the
running
of
a
program,
we
can
use
a
FOR
...
NEXT
loop
which
does
nothing
at
all
except
count
its
way
through
the
steps.
The
following
program
is
an
example:
10
FOR
T = 0
TO
5000
20
NEXT
T
30 PRINT
"ABOUT
10
SECONDS"
Another
way
to
make
a
pause
is
to
use
the
Atari's
built
in
timer:
The
three
storage
locations
18,
19
and
20
are
incremented
about
5
times
a second, so
for a 10
second
wait,
try:
10
POKE
19,0:POKE
20,0
20
IF
PEEK(19)
< 2
THEN
20
30
PRINT"
[BELL] "
(The
BELL
character
is
obtained
by
pressing
ESC
then
holding
down
CONTROL
and
pressing
2.)

Related product manuals