57
ON POWER_ON GOSUB …
Purpose To activate “POWER_ON Event Trigger”.
Syntax ON POWER_ON GOSUB SubName|SubLabel
Remarks “SubName|SubLabel” is the name or line label of a subroutine.
When the POWER key is pressed again after powering off the mobile computer,
a specific subroutine will be executed.
Example
ON POWER_ON GOSUB RESUME_ON
MAIN1:
…
LOCATE 8, 1
PWR_INDEX1&=PWR_INDEX&
PRINT “[POWER ON]”, PWR_INDEX1&
MAIN2:
IF PWR_INDEX& > PWR_INDEX1& THEN
GOTO MAIN1
END IF
…
GOTO MAIN2
RESUME_ON:
PWR_INDEX&=PWR_INDEX&+1
WAIT(100)
ON READER … GOSUB …
Purpose To activate “READER Event Trigger”.
Syntax ON READER(N%) GOSUB SubName|SubLabel
Remarks “N%” is an integer variable, indicating the reader port (usually 1 for
computers).
“SubName|SubLabel” is the name or line label of a subroutine.
When data is received from the reader port, a specific subroutine will be
executed.
Example
ON READER(1) GOSUB BcrData_1
…
BcrData_1:
OFF READER(1)
BEEP(2000, 5)
Data$ = GET_READER_DATA$(1)