EasyManua.ls Logo

Husky Hunter - Page 229

Husky Hunter
499 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...
BASIC FUNCTIONS
SECTION 5.12
KEY(n)
5.12,2 Function KEY(n) activates and terminates trapping of soft keys.
Syntax
KEY(n) ON
KEY(n) OFF
KEY(n) STOP
n is a numeric expression in the range 1 to 8 to reference
the soft key.
Example 10 ON KEY (1) GOSUB 1000
20 KEY
(1) ON
900 END 'FINISH OF MAIN ROUTINE
1000 REM SOFT KEY (1) TRAP ROUTINE
1990 RETURN
Remarks The KEY(n) statement is used for trapping either soft key
entries or cursor entries during program execution.
It is
initialised with the ON KEY (n) statement.
VER.V09F
KH (n) ON, when executed, activates trapping of the keys.
A GOSUB is automatically executed when a key is pressed to
the line number specified in the ON KEY (n) statement.
The display of the soft key funr::tion is not altered with
this statement.
If the same key is pressed again while the subroutine is
being processed, then the interrupt is stored until the
program returns from the interrupt routine when the GOSUB
will be executed again,
If a different key is pressed while one interrupt routine
is being processed, then another GOSUB is immediately exe-
cuted, Different key trapping routines may be nested, but
each individual routine cannot be re-entered.
PAGE 5 - 60