
7-6
Section
Details of BASIC Commands
228
wait
Syntax:
WAIT
<wait string> [, <line number>]
Description:
Statement. Specifies a time-out for the statement following the
WAIT
statement.
Remarks:
<wait string> specifies the waiting time, after which a time-out will occur. It has the format “
[<mm>:]<ss>.<t>” where :
<mm> specifies minutes, valid range is [00…59]. This field is optional.
<ss> specifies seconds, valid range is [00…59]. This field is mandatory.
<t> specifies tenths of seconds, valid range is [0…9]. This field is mandatory.
<line number> specifies the program line to continue execution after a time-out has occurred. It
can be any valid BASIC line number in the range : [1…65535]. If the line number specified does
not exist then an “UNDEFINED LINE NUMBER” error (code B008) will occur.
If an illegal wait time is specified an “ILLEGAL FUNCTION CALL” error (code B005) will
occur.
The
WAIT
statement monitors the statement that immediately follows it. If it finishes execution
within the specified time then program execution will continue as normal. If not then execution of
the monitored statement will terminate and execution will continue.
If <line number> is specified then, in the event of a time-out, execution will continue at the
specified line number. If not then execution will continue with the statement immediately
following the monitored statement.
The
WAIT
statement can be used to monitor the following statements:
INPUT
,
INPUT
$,
LINE INPUT
,
PC READ
,
PC WRITE
,
PC QREAD
,
PC QWRITE
,
and
LPRINT
,
FOR
,
WHILE
.
If another BASIC interrupt occurs while the
WAIT
statement is active, that BASIC interrupt
subroutine will be executed. The
WAIT
timer will be paused while the interrupt subroutine is being
executed.
Examples:
> 10 WAIT "00:1.5", 100
> 20 INPUT A$
> 30 PRINT "HELLO ";A$
> 40 END
> 100 PRINT "TOO LATE..."
> 110 END
> RUN
? TOO LATE...
See also:
Содержание C200H-ASC11
Страница 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Страница 2: ...iv...
Страница 4: ...vi...