Commands For Event Trapping; Event Triggers - CipherLab 8 Series User Manual

Hide thumbs Also See for 8 Series:
Table of Contents

Advertisement

4.5 COMMANDS FOR EVENT TRAPPING

An event is an action recognized by the mobile computer, such as a function keystroke is
detected (KEY event), a signal is received from the serial port (COM event), and so on.
There are two ways to detect the occurrence of an event and reroute the program control
to an appropriate subroutine: polling and trapping.
With event polling, the BASIC program explicitly checks for any event that happens at a
particular point in its execution. For example, the following statements cause the
program to loop back and forth until any key being pressed by user:
Loop:
KeyData$ = INKEY$
IF KeyData$ = "" THEN GOTO Loop
...
Polling is useful when the occurrence of an event is predictable in the flow of the program.
But if the time of the occurrence of an event is not predictable, trapping becomes the
better alternative because the program will not be paused by the looping statements. For
example, the following statements cause the program rerouting to the Key_F1 subroutine
when the key F1 is pressed at anytime.
ON KEY(1) GOSUB Key_F1
...
Key_F1:
...

4.5.1 EVENT TRIGGERS

This section describes a variety of events that the CipherLab BASIC can trap as well as
the related commands. Below are 10 different events that can be trapped.
1) COM Event: a signal is received from the COM port.
2) ESC Event: the ESC key is pressed.
3) HOUR_SHARP Event: the system time is on the hour.
4) KEY Event: a function key is pressed.
5) MINUTE_SHARP Event: the system time is on the minute.
6) READER Event: a barcode data is decoded.
7) TCPIP Event: any data packet is received via TCP/IP.
8) TIMER Event: a time-out condition of an activated timer.
9) TOUCHSCREEN Event: a touchable item is activated by selecting.
10) POWER_ON Event: the POWER key is pressed again after powering off the mobile
computer.
Chapter 4
BASIC Commands
47

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

83008000840087008200

Table of Contents