Original Author Paul Laughton, 2011
Page 148
De Re BASIC!
Note: the icon that appears in the Notify object will be the icon for the application in user-built apk.
Pause <ticks_nexp>
Stops the execution of the BASIC! program for <ticks_nexp> milliseconds. One millisecond = 1/1000 of a
second. Pause 1000 will pause the program for one second. A pause can not be interrupted.
An infinite loop can be a very useful construct in your programs. For example, you may use it to wait for
the user to tap a control on the screen. A tight spin loop keeps BASIC! very busy doing nothing. A Pause,
even a short one, reduces the load on the CPU and the drain on the battery. Depending on your
application, you may want to add a Pause to the loop to conserve battery power:
DO : PAUSE 50 : UNTIL x <> 0
Swap <nvar_a>|<svar_a>, <nvar_b>|<svar_b>
The values and in "a" and "b" numeric or string variables are swapped.
Tone <frequency_nexp>, <duration_nexp> {, <duration_chk_lexp}
Plays a tone of the specified frequency in hertz (cycles per second) for the specified duration in
milliseconds.
The duration produced does not exactly match the specified duration. If you need to get an exact
duration, experiment.
Each Android device has a minimum tone duration. By default, if you specify a duration less than this
minimum, you get a run-time error message giving the minimum for your device. However, you can
suppress the check by setting the optional duration check flag <duration_chk_lexp> to 0 (false). If you do
this, the result you get depends on your device. You will not get a run-time error message, but you may
or may not get the tone you expect.
Vibrate <pattern_array[{<start>,<length>}]>,<nexp>
The vibrate command causes the device to vibrate in the specified pattern. The pattern is held in a
numeric array (pattern_array[]) or array segment (pattern_array[start,length]).
The pattern is of the form: pause-time, on-time, ..., pause-time, on-time. The values for pause-time and
on-time are durations in milliseconds. The pattern may be of any length. There must be at least two
values to get a single buzz because the first value is a pause.