
7-6
Section
Details of BASIC Commands
183
on time$
Syntax:
ON TIME
$ = <time string expression>
GOSUB
(<line number> | <label>)
Description:
Statement. Defines an interrupt subroutine to handle time$ interrupts.
Remarks:
<time string expression> is an absolute time in the format “hh:mm:ss”. Where hh has a range
[00…23], mm has a range [00…59] and ss has a range [00…59].
Wildcards, specified using ‘*’, can be used to define multiple time interrupts, for instance:
“02:30:**” means that from 0230 hrs 60 interrupts will occur at one second intervals.
“02:3*:00” means that from 0230 hrs 10 interrupts will occur at one-minute intervals.
<line number> specifies the start of the interrupt subroutine (ISR).
<label> is a BASIC program label. It references a line number somewhere in the BASIC program.
The time$ interrupts are enabled by the
TIME
$
ON
statement and disabled by the
TIME
$
OFF
statement. The
TIME
$
STOP
statement masks and enables the time$ interrupts so the interrupts are
recorded but the ISRs are not executed until the next
TIME
$
ON
statement unmasks the interrupts.
The ISR should be terminated by a
RETURN
statement. When the
RETURN
statement is reached,
execution will resume at the statement where the program was interrupted.
Only one time$ interrupt can be valid at any one time. If two or more
ON TIME
$ statements are set
in a single program, only the last
ON TIME
$ statement’s interrupt will be valid.
While the time$ interrupt subroutine is being executed, other incoming interrupts will be recorded
but not executed. These stopped interrupts will be executed in order of their priority after the
time$ interrupt subroutine has been completed.
For more information on writing interrupts in BASIC, refer to the
ON COM
and
ON PC
examples in
5-5 Interrupt Functions.
Examples:
> 10 ON TIME$ = “08:00:00” GOSUB 100
> 20 TIME$ ON
> 30 GOTO 30
> 100 PRINT “WAKE-UP!!!”
> 110 RETURN
See also:
TIME
$ (
ON
|
OFF
|
STOP
),
ON ALARM
Содержание C200H-ASC11
Страница 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Страница 2: ...iv...
Страница 4: ...vi...