PI1X Basic Programming Manual Ver. 1.10
21/156
Purpose
:
To repeat the execution of a block of statements while a
certain condition is TRUE.
Syntax
:
WHILE condition
[Statement Block]
WEND
Example
:
N%=1
WHILE 1
PRINT "Cnt=",N%
N%=N%+1
IF N%>5 THEN
EXIT
END IF
WEND
Description
:
If the
condition
is true, loop statements are executed until the
WEND statement is encountered. Then the program
execution returns to WHILE statement and checks the
condition again. If it is still true,the process will be repeated.
Otherwise the execution continues with the statement
following the WEND statement.