52
CipherLab BASIC Programming Part I
ON COM … GOSUB …
Purpose To activate “COM Event Trigger”.
Syntax ON COM(N%) GOSUB SubName|SubLabel
Remarks “N%” is an integer variable, indicating the COM port.
“SubName|SubLabel” is the name or line label of a subroutine.
When data is received from the COM port, a specific subroutine will be
executed.
Example
ON COM(1) GOSUB HostCommand
…
HostCommand_1:
OFF COM(1)
…
ON COM(1) GOSUB HostCommand
ON ESC GOSUB …
Purpose To activate “ESC Event Trigger”.
Syntax ON ESC GOSUB SubName|SubLabel
Remarks “SubName|SubLabel” is the name or line label of a subroutine.
When the ESC key is pressed, a specific subroutine will be executed.
Example
ON ESC GOSUB Key_Esc
…
Key_Esc:
OFF ESC
…
ON ESC GOSUB Key_Esc