Original Author Paul Laughton, 2011
Page 133
De Re BASIC!
Time ,, day$,,,, wkday % returns the today's day and weekday
TimeZone.set { <tz_sexp> }
Sets the timezone for your program. If you don't specify a timezone, it is set to the default for your
device, which is based on where you are. If you specify a timezone your device does not recognize, it is
set to "GMT". (In Android, GMT is exactly the same as UTC).
TimeZone.get <tz_svar>
Returns the current timezone in the string variable. This is the default timezone for your device and
location, unless you have changed it with TimeZone.set.
TimeZone.list <tz_list_pointer_nexp>
While timezones are defined by international standards, the only ones that matter to your program are
those recognized by your device. This command returns all valid timezone strings, putting them in the
list that <tz_list_pointer_nexp> points at. The previous contents of the list are discarded. If the pointer
does not specify a valid string list, and the expression is a numeric variable, a new list is created and the
variable is set to point to the new list.
Timer Interrupt and Commands
You can set a timer that will interrupt the execution of your program at some set time interval. When
the timer expires, BASIC! jumps to the statements following the OnTimer: label. When you have done
whatever you need to do to handle this Timer event, you use the Timer.resume command to resume
execution of the program at the point where the timer interrupt occurred.
The timer cannot interrupt an executing command. When the timer expires, the current command is
allowed to complete. Then the timer interrupt code after the OnTimer: label executes. If the current
command takes a long time to finish, it may appear that your timer is late.
The timer cannot interrupt another interrupt. If the timer expires while any interrupt event handler is
running, the OnTimer: interrupt will be delayed. If the timer expires while the OnTimer: interrupt
handler is running, the timer event will be lost. The OnTimer: interrupt code must exit by running
Timer.resume, or the timer interrupt can occur only once.
Timer.set <interval_nexp>
Sets a timer that will repeatedly interrupt program execution after the specified time interval. The
interval time units are milliseconds. The program must also contain an OnTimer: label.
OnTimer:
Interrupt label for the timer interrupt. (See "Interrupt Labels" and "Timer Interrupts and Commands".)
Timer.resume
Resumes execution at the point in the BASIC! program where the OnTimer: interrupt occurred.