EasyManua.ls Logo

Atari 400

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
Loading...
144 User's
Handbook
to
the
Atari 400/ 800
Computers
ON
The
ON
statement
is
used
to
branch program
control.
When
used with a
GOTO
statement, the
ON
statement branches
program
control
to
one
of
several lines. An
ON
statement
is
also
used
with
GOSUB to branch a program
to
one
of
several
subroutines.
CONFIGURA
TION
fGosuBj
ON
X
LGOTO}N[,LN]
..
.
The argument
of
ON
is
the
control
expression. When a GOSUB
statement
is
used, the program proceeds
to
a subroutine. When
a
GOTO
statement
is
used, the program branches
to
a
line
number.
The
control
expression determines to
which
line
number
the
program
will
proceed. If the control expression equals
1,
the
program branches
to
the first line
number
after the
GOTO
or
GOSUB.
If
the
control
expression equals
2,
the program
branches
to
the
second line
number
after
GOTO
or
GOSUB, etc.
If the
control
expression does
not
equal
an
integer,
it
is
rounded
.
If
the
control
expression eval uates to 0
or
a
number
greater than
the
number
of
choices
of
line
numbers, the statement
following
the
ON
statement
is
executed.
If the
control
expression
is
less
than 0
or
greater than
255,
an
error
results.
EXAMPLE
10 X = 2
20
ON
X
GOTO
30,
40
,
50
30
PRINT "FIRST" :
END
40
PRINT "SECOND
":
END
50
PRINT "THIRD":
END
RUN
SECOND

Other manuals for Atari 400

Related product manuals