290
____________________________________________________________________
Flow control statement
WHILE…WEND
Continues to execute a statement block as long as the conditional expression is true.
____________________________________________________________________
Syntax:
Syntax:Syntax:
Syntax:
WHILE conditionalexpression
[statementblock]
WEND
Description:
Description:Description:
Description:
A WHILE ..WEND continues to execute statementblock as long as the
conditionalexpression is true (not zero) according to the steps below.
(1) The conditionalexpression in the WHILE statement is evaluated.
(2) If the condition is false (zero), the statementblock is bypassed and control passes to
the first statement following the WEND.
If the condition is true (not zero), the statementblock is executed. When WEND
statement is encountered, control returns to the WHILE statement. (Go back to step (1)
to be repeated.)
• The WHILE and WEND cannot be written on a same program line.
• If no WEND is written corresponding to the WHILE, a syntax error occurs.
• The BHT-BASIC does not support a DO..LOOP statement block.
• You can nest the WHILE ..END statements to a maximum of 10 levels.
• When using the WHILE ..WEND statement together with block-structured statements
(DEF FN ..END DEF, FOR ..NEXT, FUNCTION ..END FUNCTION,
IF ..THEN ..ELSE ..END IF, SELECT ..CASE ..END SELECT, SUB ..END SUB,
and WHILE ..WEND), you can nest them to a maximum of 30 levels.
WHILE a
WHILE b
WHILE c
•
•
•
WEND
WEND
WEND
Kommentare zu diesen Handbüchern