EasyManua.ls Logo

Laser 128 - On Gosub and on

Laser 128
255 pages
Print Icon
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...
BASIC COMMANDS AND STATEMENTS
3.39
ON
...
GOSUB
and
ON
...
GOTO
Purpose:
To
direct
the
program
flow
depending
on
the
value
of
an
expression
.
Format:
ON expression
GOSUB
linenumber 1
[.
linenumber 2
...
]
ON expression
GOTO
linenumber
1
[.
linenumber 2
...
]
Comments:
The
value
of
the
ex
pression
must
always
be
an
integer
less
than
or
equal
to
255. When
it
is
evaluated,
it
directs
program
flow
to
the
corresponding
line
number
in
the
list
following
either
the
GOSUB
or
the
GOTO
statements.
For
instance,
if
the
expression
comes
to
five,
then
the
prog
ram
will
branch
to
the
fifth
line
number,
and
if
it
comes to
nine,
it
will
go
to
the
ninth
line
number.
II-
71

Table of Contents