Denso Power Net Terminal BHT-7500 Spécifications Page 169

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 560
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 168
160
9.4 Event (of Keystroke) Trapping
[ 1 ] Overview
If any of the function keys previously specified for keystroke trapping is pressed, event trapping
makes the program cause an interrupt so as to transfer control from the current program to the
specified event-handling routine.
This trapping facility checks whether any of the function keys is pressed or not between every
execution of the statements.
[ 2 ] Programming for trapping keystrokes
To trap keystrokes, use both the ON KEY...GOSUB and KEY ON statements. The ON
KEY
...GOSUB statement designates the key number of the function key to be trapped and the
event-handling routine (to which control is to be transferred if a specified function key is
pressed) in its label. The
KEY ON statement activates the designated function key.
This trapping cannot take effect until both the
ON KEY...GOSUB and KEY ON statements have
been executed.
The keystroke of an unspecified function key or any of the numerical keys cannot be trapped.
The following program sample will trap keystroke of function keys F1, F2, and F3 (these keys
are numbered 1, 2, and 3, respectively).
ON KEY (1) GOSUB sub1
ON KEY (2) GOSUB sub2
ON KEY (3) GOSUB sub3
KEY (1) ON
KEY (2) ON
KEY (3) ON
.
.
.
(Main routine)
.
.
.
END
sub1
(Event-handling routine 1)
RETURN
sub2
(Event-handling routine 2)
RETURN
sub3
(Event-handling routine 3)
RETURN
Vue de la page 168
1 2 ... 164 165 166 167 168 169 170 171 172 173 174 ... 559 560

Commentaires sur ces manuels

Pas de commentaire