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 #195 background imageLoading...
Page #195 background image
Chapter
10
I
BASIC Keywords
0
You can trap any key, including
(CTRL]
@J,
[CTRLIIBREAK),
and
[CTRL]
[DELETE)
(the soft boot). This feature makes
it possible
to
prevent BASIC application users from con-
trol-breaking out
of
a program
or
from accidentally reset-
ting the computer.
You can use the KEYITrap statement in
a
key trapping routine
with the
ON
KEYO GOSUB statement
to
detect when a specific
key is pressed.
The KEYO
ON
statement turns on key trapping for a specific
key. BASIC checks after each program statement
to
see if the
specified key has been pressed. If
so,
BASIC transfers program
control
to
the line number specified in the
ON
KEY() GOSUB
statement. For example:
KEY(3)
ON
ON
KEY(3)
GOSUB
1000
BASIC
turns
on a trap for
m.
BASIC continues
to
execute the
other program statements, checking after each statement
to
see
if
iF3]
has been pressed. When
IF3]
is pressed, BASIC branches
to
the subroutine beginning at Line
1000.
KEYO STOP temporarily halts trapping for the specified key. If
the specified key is pressed, BASIC does not transfer program
control
to
the
ON
KEYO GOSUB until you turn on key trapping
again with a KEY()
ON
statement. BASIC remembers that the
key was pressed and branches
to
the subroutine immediately
after key trapping is turned on again.
KEY() OFF turns off key trapping. BASIC does not remember
that the key has been pressed when key trapping is turned on
again.
Note:
Key trapping only occurs while BASIC is run-
ning a program.
See
ON
KEY() GOSUB
for
more information on key trapping.
Sample
Program
See
ON
KEY() GOSUB.
193

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