ON ERROR GOTO RESUME |
[Features] The start line of a
processing routine when the interrupt by 'ERROR' occurs is defined.
[Format] ON ERROR GOTO
Linenumber
[Explanation]
An error routine is ended by 'RESUME' and it
returns to the original program.
resume -It resumes from the sentence of the agency making an
error.
resume
next -It resumes from the next sentence of an error.
resume
'linenumber' -It resumes from the specified line number.
In compile mode, all become operation of
'resume next'.
When line number=0,
Error interrupt is turned off.
About interruption.(general)
Other interruption
routines return to the original program by 'RETURN'.
Each labels can be used for
all jump point specify. [on~goto,gosub]
In the inside of each interruption
routine, interruption processing is interrupted.
Please perform the on/off change of the
interruption outside user function domain.
[e.g.] The example of interruption processing.
[smp_intrpt.bas]
10 on error goto 100
20 on stop
gosub 110 : stop on
30 on
time$="12:00:00" gosub 120 : time$ on
40 on interval gosub 130 : interval 1000: interval on
50 on play gosub 140 : play"music.wav":
play on
60 on touch gosub 150 : touch
on
70 pause 50 : goto 70
100 print"Error." : resume next
110 print"Stop." : return
120 print"Noon." : return
130 print"Second." : return
140 print"Play end." : return
150print"X=";touch(0);"Y=";touch(1) :
return
ON STOP GOSUB |
[Features] The start line of a
processing routine when the interrupt by 'Press STOP key' occurs is defined.
[Format] ON STOP GOSUB
Linenumber
[Explanation]
There is a case where it becomes impossible
to stop if the discontinuation command isn't included.
STOP ON/OFF
Interruption permission control.
[e.g.]
ON TIME$ GOSUB |
[Features] The start line of a
processing routine when the interrupt by 'ScheduleTime' occurs is defined.
[Format] ON TIME$ GOSUB
Linenumber
[Explanation]
TIME$ ON/OFF
Interruption permission control.
[e.g.]
ON INTERVAL GOSUB |
[Features] The start line of a
processing routine when the interrupt by 'IntervalTimer' occurs is defined.
[Format] ON INTERVAL GOSUB
Linenumber
[Explanation]
There are two kinds of interruption section
notations.
1. interval n : on
interval gosub ...
2. on interval=n
gosub ...
INTERVAL ON/OFF
Interruption permission control.
[e.g.]
ON PLAY GOSUB |
[Features] The start line of a
processing routine when the interrupt by 'PlayEnd Channel0' occurs is
defined.
[Format] ON PLAY
GOSUB Linenumber
[Explanation]
PLAY
ON/OFF Interruption permission control.
[e.g.]
ON TOUCH GOSUB |
[Features] The start line of a
processing routine when the interrupt by 'Touch-on/Release at Panel' occurs is
defined.
[Format] ON TOUCH
GOSUB Linenumber
[Explanation]
TOUCH ON/OFF Interruption permission control.
[e.g.]
ON BLUETOOTH GOSUB |
[Features] The start line of a
processing routine when the interrupt by 'BLUETOOTH data reception' occurs is
defined.
[Format] ON BLUETOOTH
GOSUB Linenumber
[Explanation]
BLUETOOTH ON/OFF Interruption permission control.
cf: BLUETOOTH ON/OFF (Item:Bluetooth)
[e.g.]
10 bt_open "server"
20 on bluetooth gosub 100
30 bluetooth on
40 pause 1:goto 40
100 print bt_input$();:return