EasyManuals Logo

Radio Shack Telephone Interface II Manual

Radio Shack Telephone Interface II
126 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
Page #65 background imageLoading...
Page #65 background image
e
8. GOSUB
statement,
RETURN
statement
When
you use
a
certain processing procedure a number of times,
you will
have
a more
efficient
program
if
you
handle
these procedures
as
a sub-routine.
When
a program comes
to
a GOSUB statement, the Computer moves
to
a
specified
line
or
label
and
executes the
programs stored
there.
At
the end
of
a
sub-routine
you
must
add a RETURN statement,
which
returns program
execu-
tion
to the
statement immediately
after the GOSUB statement.
A subroutine can
contain other
subroutines, up to a maximum of 4
levels.
(1)
GOSUB statement
General
form
{1)
GOSUB
<
Expression
>
Example:
GOSUB 10
GOSUB A
General
form
(2)
GOSUB
"Character"
[Character
variable]
Example:
GOSUB
"ABC"
GOSUB A$
<
The
RETURN statement
must
be at
the end
of
a
line
(it can
not be followed
by
any
other
another
statement
on
the
same
line.
(2)
RETURN
statement
General
form
RETURN
The
RETURN
statement must be at
the end
of
a
line
(it
can not
be
followed
by
any
other
statement
on
that line).
Note: An
error (error
code:
3)
occurs,
if
a
RETURN
is used
without
a
GOSUB earlier
on.
Also
be
sure
to
put
END statement
on
end of
main
routine,
else
computer
will
go
into
subroutine
and error
3
will
occur.
Example
1
Main
routine
80;
GOSUB400'
220:GOSUB300'
Subroutine
(1st
stage)
.400:
450:
GOSUB
:
510'
500:
RETURN
300:
"340
: RETURN
Subroutine
(2nd
stage)
510:
560:
GOSUB600
Subroutine
(3rd
stage)
600:
590:
RETURN
URN
62

Other manuals for Radio Shack Telephone Interface II

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Radio Shack Telephone Interface II and is the answer not in the manual?

Radio Shack Telephone Interface II Specifications

General IconGeneral
BrandRadio Shack
ModelTelephone Interface II
CategoryDesktop
LanguageEnglish

Related product manuals