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 #234 background imageLoading...
Page #234 background image
Chapter
10
I
BASIC
Keywords
ON
KEY()
GOSUB
Statement
ON
KEY(number)
GOSUB
line
Transfers program control to a subroutine when you press the
specified key.
Number
may be
a
number in the range
1
to 20, indicating the
number of the key to trap. Function keys use their corresponding
function key numbers. The cursor direction keys are numbered:
11
12
El
13
El
14
m
El
User keys are numbered
15
through 20. User keys are defined
with the KEY statement.
Line
is the
first
line number in the subroutine to execute when
the specific key
is
pressed. If you specify Line
0,
you turn off key
trapping for that key.
It
is
the same
as
executing a KEYO OFF
statement. Use the RETURN statement to exit the subroutine.
BASIC executes the ON KEYO GOSUB statement only if a
KEYO ON statement has been executed previously to enable key
trapping for that key.
If
a KEYO STOP statement has been issued to halt key trapping
for that key temporarily, BASIC executes the subroutine immedi-
ately after the next KEYO ON statement for that key.
When you execute the ON KEY() GOSUB statement, BASIC im-
mediately issues a KEYO STOP statement for that key to pre-
vent recursive traps. When BASIC executes the RETURN from
the subroutine,
it
automatically executes another KEY
()
ON
statement for that key to enable key trapping again, unless the
subroutine executes a KEYO OFF statement for that key.
232

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