WHILE…WEND executes a set of statements if a condition is true.
‘numeric expression’ is evaluated true or false; if the expression is true the statements following are executed. If false, the statement after WEND is executed. The loops may be nested; each WEND associated with the most recent WHILE.
10 FOR Q=1 TO 10 20 B(Q)=Q 30 NEXT 110 WHILE A< 11 120 FOR I = 1 TO 10 130 PRINT B(I); 140 NEXT 150 PRINT A:A = A+1 160 WEND
The matrix B is printed as long as the A parameter is less than 11.
WHILE cannot be used with a string expression. The statements WHILE and WEND must be on separate lines and no other statements must be on those lines.