EasyManuals Logo

Tandy 1000 Basic Reference Manual

Default Icon
411 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 #231 background imageLoading...
Page #231 background image
Chapter
10
I
BASIC Keywords
ONIGOSUB
Statement
ON
n
GOSUB
Zine[,Zine,
...
I
Looks
at
n
and transfers program control
to
the subroutine indi-
cated by the nth line listed.
For example, if
n
equals
1,
BASIC branches to the first line
listed; if
n
equals 2, BASIC branches to the second line listed.
Line
is the subroutine line at which execution begins when
BASIC makes the branch.
N
must be a number in the range 0
to
255. If necessary, BASIC
rounds
n
to
an integer before evaluating it. If
n
is 0 or greater
than the number
of
line numbers listed, BASIC continues with
the next statement. If
n
is negative
or
is greater than 255, an
“Illegal function call” error occurs.
Use the RETURN statement
to
exit the subroutine.
Example
10
ON
Y
GOSUB
1000,
2000,
3000
If
Y
equals
1,
BASIC branches to a subroutine, beginning
at
Line 1000. If
Y
equals 2, BASIC branches to
a
subroutine, be-
ginning at Line 2000. If
Y
equals 3, BASIC branches to a sub-
routine, beginning at Line 3000.
If
Y
is outside the range
1
to
3, BASIC either continues with the
next statement
or
generates an “Illegal function call,”
as
men-
tioned earlier.
229

Table of Contents

Other manuals for Tandy 1000

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Tandy 1000 and is the answer not in the manual?

Tandy 1000 Specifications

General IconGeneral
ProcessorIntel 8088
Processor Speed4.77 MHz
RAM128 KB (expandable to 640 KB)
Operating SystemMS-DOS 2.11
ManufacturerTandy Corporation
Release Year1984
StorageSingle or double 5.25" floppy disk drive (360 KB), optional hard drive
SoundTandy 3-voice sound
PortsParallel, Serial
GraphicsCGA (Color Graphics Adapter)
Graphics Modes320x200, 640x200

Related product manuals