EasyManua.ls Logo

Commodore Plus 4 - Page 148

Commodore Plus 4
234 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...
EXAMPLE:
GET#1,A$
GOSUB
GOSUB//ne#
GOTO
or
GO
TO
This
statement
is
like
the
GOTO
statement,
except
that
the Plus/4
re
members
where
it
came
from.
When
a
line
with
a
RETURN
statement
is
encountered,
the
program
jumps
back
lo
the
statement
immediately
following the
GOSUB.
The
target
of
a
GOSUB
statement
is
called a
subroutine.
A
subroutine
is
useful
if
there
is
a
routine
in
your
program
that
can
be
used
by
several
different
portions
of
the
program.
Instead
of
duplicating
the
section
of
program
over
and
over,
you
can
sei
it
up
as
a
subroutine,
and
GOSUB
to
it
from
the
different
parts
of
the
pro
gram.
See
also
the
RETURN
statement.
EXAMPLE;
20
GOSUB
800
means
go
to
the
subroutine
begin
ning
at
line
800
and
execute
it.
800
PRINT
"HI
THERE":RETURN
GOTO
line
#
After
a
GOTO
statement
is
executed,
the
next
line
to
be
executed
will
be
the
one
with
the
line
number
following
the
word
GOTO.
When
used
in
direct
mode,
GOTO
line
#
allows
you
to
start
execution
of
the
pro
gram
at
the
given
!ine
number
without
clearing
the
variables.
EXAMPLE:
10
PRINT-COMMODORE"
20
GOTO
10
-*—
The
GOTO
in
line
20
makes
line
10
repeat
continuously
until
you
press
RUN/STOP
GRAPHIC
GRAPHIC
<mode
[.clear
option}
I
CLR>
This
statement
puts
the Plus/4
in
one
of
its
5
graphic
modes:
139
-

Other manuals for Commodore Plus 4

Related product manuals