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 #46 background imageLoading...
Page #46 background image
36
The
Ateri
XL
Handbook
are
carried
out
if
the
condition
is
met,
otherwise
the
program
continues
at
the
next
line.
IF' ...
THEN
can
also
be
used
to
control
jumps:
10
PRINT
"WHAT
NUMBER
AM
I
THINKING
OF";
20
INPUT N
30
IF
N <
>
3
THEN
PRINT
"WRONG"
:
GOTO
10
40 PRINT "CORRECT!"
If
the
jump
is
the
only
instruction
after
THEN,
the
word
GOTO
can
be
omitted:
10
DIM
A$(20)
20
PRINT
"WHAT
AM
I";
30
INPUT A$
40
IF
A$
=
"ATARI
XL"
THEN
80
50
PRINT:
PRINT
A$;"?
NO,
TRY
AGAIN"
60
PRINT
70
GOTO
20
80
PRINT:
PRINT
"GOOD
GUESS!"
Variables
can
be
used
to
direct
a
GOTO
command:
10
JUMP
= 40
20
GOTO
JUMP
30
PRINT
"THIS
LINE
IS
MISSED"
40 PRINT "JUMPS TO HERE"
EXAMPLE PROGRAM - SORTING NUMBERS
As
an
example
of
what
can
be
done
using
loops
and
decisions,
here
is
a
program
which
sorts
ten
numbers
into
ascending
order.
10
REM
SORTING
PROGRAM

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