Original Author Paul Laughton, 2011
Page 90
De Re BASIC!
If the program does have an OnError: label, BASIC! does not stop on an error. Instead, it jumps to the
OnError: label (see "Interrupt Labels", above). The error message is not printed, but it can be retrieved
by the GETERROR$() function.
Be careful. An infinite loop will occur if a run-time error occurs within the OnError: code. You should not
place an OnError: label into your program until the program is fully debugged. Premature use of
OnError: will make the program difficult to debug.
OnConsoleTouch:
Interrupt label that traps a tap on a line printed on the Output Console. BASIC! executes the statements
following the OnConsoleTouch: label until it reaches a ConsoleTouch.resume. Note that you must touch
a line written by a PRINT command, although it may be blank. BASIC! Ignores any touch in the empty
area of the screen below the printed lines.
After touching a Console line, you may use the Console.Line.Touched command to determine what line
of text was touched.
This label allows the user to interrupt an executing BASIC! program in Console mode (not in Graphics
mode). A common reason for such an interrupt would be to have the program request input via an
INPUT statement. See the Sample File, f35_bluetooth.bas, for an example of this.
To detect screen touches while in graphics mode, use OnGrTouch:.
ConsoleTouch.resume
Resumes execution at the point in the BASIC! program where the OnConsoleTouch: interrupt occurred.
OnBackKey:
Interrupt label that traps the BACK key. BASIC! executes the statements following the OnBackKey: label
until it reaches a Back.resume. If a BASIC! program does not have an OnBackKey: label, the BACK key
normally halts program execution.
If you trap the BACK key with OnBackKey:, the BACK key does not stop your program. You should either
terminate the run in the OnBackKey: code or provide another way for the user to tell your program to
stop, especially if the program is in Graphics mode where there is no menu. If you do not then there will
be no stopping the program (other than using Android Settings or a task killer application).
Back.resume
Resumes execution at the point in the BASIC! program where the OnBackKey: interrupt occurred.
OnMenuKey:
Interrupt label that traps the MENU key. BASIC! executes the statements following the OnMenuKey:
label until it reaches a MenuKey.resume. Note: This interrupt does not work unless your device has a
MENU key. Android devices since Honeycomb typically do not have a MENU key.