74
User's
Handbook
to
the Atari
400
/
800
Computers
When
the Atari runs
out
of
BASIC program statements,
an
END
statement
is
automatically executed.
Atari BASIC Functions
Functions
are used in Atari BASIC
to
perform
predefined
calculations
or
operations on
their
arguments. All
functions
use
the
following
format.
function
(argument)
function
is
the
keyword
for
the
function
.
argument
is
a variable,
constant,
or
expression
which
is
to
be used in the
operation
defined
by the
function.
The
following
statement
is
an
example
of
the
use
of
the SQR
function.
100
A = SQR(49)
In this example,
Awould
evaluateat
7.
SQR
is
the
keyword
which
describes the square
root
function
. The square
root
of
49
is,
of
course, equal
to
7.
Functions can be used
with
arithmetic, relational, and Boolean
expressions,
as
shown in the
following
statement.
100
X =
100
- 7 * SQR(49)
In
an
expression
containing
functions
as
well
as
arithmetic,
relational,
and/or
Boolean operators, the
function's
value
is
calculated first. In
our
preceding example, the square
root
of
49
would
be calculated, that value
would
be
multiplied
by
7,
and
the
product
subtracted
from
100.
The various Atari BASIC functions are described in
Chapter
5.