EasyManuals Logo

Atari 400 User Manual

Atari 400
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
Page #129 background imageLoading...
Page #129 background image
Atari
BASIC
Reference Guide 127
The expression
(EX)
that
follows
IF
can be logical
or
algebraic.
Any
algebraic expression that does
not
equal
zero
is
considered
true. The logical operators
(AND,
NOT
and OR) can be used in
the
IF
expression.
10
X =
15
20
Y =
30
EXAMPLE
30
IF
X>10
AND
Y>20
THEN
50
40
PRINT
"CONDITIONS
NOT
MET":END
50
PRINT
"CONDITIONS
HAVE
BEEN
MET"
RUN
CONDITIONS
HAVE
BEEN
MET
The previous
example shows
two
logical expressions and a
logical
operator
in the
IF
/ THEN statement (line
30).
The
AND
will
only
be
true
when
both
conditions
have been met. Since X =
15
(line
10)
and Y =
30
(line 20),
both
of
the
conditions
of
line
30
are
true.
As
a result, the
program
branches
to
line
50.
At
line
50,
the
message
CONDITIONS
HAVE
BEEN
MET
is
printed.
An
END statement
is
used in
line
40
to
prevent
both
messages
from
being
printed
when
the
IF
statement
is
false.
An IF/THEN statement can also be
followed
by statements
instead
of
a
line
number.
10 Y = 5
20
X =
10
EXAMPLE
30
IF
X<100
THEN PRINT X:PRINT Y
RUN
10
5
The previous example shows that statements can
follow
a THEN
statement, separated
by
colons.
If
the
condition
is
true,
the
statements are executed.
If
the
condition
is
false,
the
program
will
continue
at
the next
line
, and the statements after
the
THEN
statement are
ignored
.
Si
nce X =
10
(line 20), the
condition
at
line

Other manuals for Atari 400

Questions and Answers:

Question and Answer IconNeed help?

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

Atari 400 Specifications

General IconGeneral
ManufacturerAtari
Model400
TypeHome Computer
Release Year1979
CPUMOS Technology 6502
CPU Speed1.79 MHz
ROM10 KB
Operating SystemAtari OS
KeyboardMembrane keyboard
RAM8 KB (expandable to 48 KB)
GraphicsANTIC and GTIA chips
Sound4 channels
DisplayRF output for connection to TV
StorageOptional cassette tape drive or floppy disk drive
PortsCartridge
Display Resolution320x192 (16 colors)

Related product manuals