while...wend - while statement
statement is used to perform looping based on the continued truth
of a logical expression with the evaluation of this expression occurring
at the top of the loop; i.e. prior to each pass through the loop.
Upon encountering the
NumExpr is evaluated.
If it has a non-zero value ("true"), the loop statements are executed
in sequence until
At this point, NumExpr is again evaluated and the entire process repeats.
If NumExpr is non-zero (true), another pass through the loop statements
If NumExpr is zero (false),
the loop is exited and
the statement immediately following
is the next to be executed.
There is no limit on the depth of
is matched to the lexically nearest unmatched
This example sorts the elements of the string array a$ into lexicographic
order based on the ASCII representation.
a$ was defined with j elements.
undone = 1
undone = 0
for i = 1 to j - 1
if a$(i) > a$(i + 1) then_
swap a$(i), a$(i + 1) : undone = 1
The Basmark QuickBASIC Programmerís Manual