EasyManua.ls Logo

Commodore Plus 4 - Page 76

Commodore Plus 4
464 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...
64
The
BASIC
Language
ON
...
GOTO
Abbr.
on/gO
ON
number
GOTO
line
number,
line
number,
etc.
Branches
the
program
to
one
of
a
list
of
line
numbers.
The
selection
is
based
on
the
condition
of
the
ON
value
and
the
position
of
the
line
numbers
in
the
GOTO
list.
Each
time
ON...
GOTO
executes,
only
one
of
the
line
numbers
in
the
GOTO
list
is
used.
When
the
ON
value
equals
1,
the
computer
goes
to
the
first
line
number
in
the
GOTO
list.
When
the
ON
value
equals
2,
the
computer
goes
to
the
second
line
number
in
the
GOTO
list,
and
so
on.
ON
...
GOTO
is
similar
to
IF
...
GOTO,
but
ON
lets
you
include
a
series
of
GOTO
lines
while
IF
lets
you
include
only
one.
Parameters:
ON
value
GOTO
line
number
list
1.
The
ON
value
can
be
a
variable
or a
calculation.
It
cannot
be
a
negative
number.
If
it
is
equal
to
zero
or
a
number
that
is
greater
than
the
number
of
line
numbers
in
the
GOTO
command,
no
GOTO
is
executed.
If
it
is
not
a
whole
number,
its
truncated
value
is
used.
For
example,
if
there
are
four
line
numbers
in
the
GOTO
command
(e.g.,
ON
number
GOTO
40,70,100,130),
the
number
must
be
greater
than
or
equal
to
1
and
less
than
5
for
a
GOTO
to
be
executed.
2.
The
ON
value
selects
a
line
number
from
the
GOTO
list
based
on
its
relative
position
in
the
GOTO
list.
Example:
10
TRAP
130
20
IITPUT
"WHAT
YEAR
(1985-1994)";Y
30
PRIFT
"1TEW
YEAR'S
DAY
PALLS
ON
";
40
0NY-1984G0T0
70,80,90,100,120,60,70,80,100,120
50
PRINT^IWVALID
INPUT":GOT020
60
PRINT"MONDAY":END
70
PRIWT"TUESDAY":END
80
PRINT"WEDNESDAY":END
90
PRINT"THURSDAY":END
100
PRINT"PRIDAY":END
110
PRINT"SATURDAY":END
120
PRDOT"SUNDAY":END
130
RESUME
50
OPEN
Abbr.
oP
OPEN
file
number,
device,
secondary
address,
file
name
Opens
access
to
a
peripheral
device
or
to
a
tape
or
disk
file.
Devices
and
files
must
be
OPENed
before
you
can
issue
other
commands
(such
as
INPUT#
or
PRINT#)
to
them.
You
do
not
have
to
use
OPEN
before
you
load
or
save
a
program.

Other manuals for Commodore Plus 4

Related product manuals