
7-6
Section
Details of BASIC Commands
230
while / wend
Syntax:
WHILE
<numerical expression> <program>
WEND
Description:
Statement. Conditionally repeats the series of statements enclosed between
WHILE
and
WEND
.
Remarks:
The results of <numerical expression> determines the termination of the loop. If the result of the
<numerical expression> is zero (or
FALSE
) then the loop will terminate and execution will resume
at the line number following the
WEND
statement. If the <numerical expression> is non-zero (or
TRUE
) then the loop will continue.
When the
WEND
statement is reached execution jumps back to the
WHILE
statement containing the
condition.
If the condition is never true then the statements in the
WHILE
/
WEND
loop will never be executed.
Unlike
FOR
/
NEXT
loops that have a specified number of repetitions, the
WHILE
/
WEND
loops have a
repetition condition. For example, use a
WHILE
/
WEND
loop if a particular process is needed to
repeat until X=0 and the number of repetitions that are required is unknown.
WHILE
/
WEND
must always be used in pairs. If a wend statement is encountered without a
corresponding while then a “MISMATCH: WHILE/WEND” error (code B024) will occur.
WHILE
/
WEND
statements may be nested and the only limit on nesting is the amount of available
memory.
Examples:
10 A = 0
20 WHILE A<10
30 PRINT A
40 A = A+1
50 WEND
See also:
@
IF
,
FOR
Summary of Contents for C200H-ASC11
Page 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Page 2: ...iv...
Page 4: ...vi...