58
CipherLab BASIC Programming Part I
ON TCPIP GOSUB…
Purpose To activate “TCP/IP Event Trigger”.
Syntax ON TCPIP GOSUB SubLabel
Remarks “SubLabel” is the line label of a subroutine.
When data is received from any TCP/IP conn
ection or some error is taking
place, a specific subroutine will be executed.
The GET_TCPIP_MESSAGE routine is used to identify the status of TCP/IP
connections.
Example
ON TCPIP GOSUB TCPIP_Trigger
…
TCPIP_Trigger:
ON TIMER … GOSUB …
Purpose To activate “TIMER Event Trigger”.
Syntax ON TIMER(N%, duration%) GOSUB SubName|SubLabel
Remarks
“N%”
is an integer variable in the range of 1 to 5, indicating the ordinal
number of timer.
“duration%” i
s an integer variable, indicating a specified period of time in units
of 10 ms.
“SubName|SubLabel” is the name or line label of a subroutine.
When the system runs out of the time duration specified by user, a specific
subroutine will be executed. Up to fiv
e timers can be set in a BASIC program.
Be sure the timer IDs are different. Otherwise, the latter created timer will
overwrite the former one.
Example
ON TIMER(1, 200) GOSUB ClearScreen ‘ TIMER(1) = 2 sec
…
ClearScreen:
OFF TIMER(1)
CLS
ON TOUCHSCREEN GOSUB… 8500, 8700
Purpose To activate “TOUCHSCREEN Event Trigger”.
Syntax ON TOUCHSCREEN GOSUB SubName|SubLabel {, SubName|SubLabel}
Remarks “SubName|SubLabel” is the name or line label of a subroutine.
When the touch screen is enabled, a specific subroutine will be executed.
Example
ON TOUCHSCREEN GOSUB CHECK_FUN
…
CHECK_FUN:
NO% = GET_SCREENITEM