83
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
Syntax:
do [ while | until ] expression
statement1
statement2
…
[exit do]
...
statementN
loop
or:
do
statement1
statement2
…
[exit do]
...
statementN
loop [ while | until ] expression
Scope:
Local and HTML
See Also:
,
Part
Description
expression
A logical expression which is evaluated either before or
after the first time the statements are executed.
statement[1,
2...]
Lines of code to be executed.
Details
The do-loop statement repeats a block of code. If the condition (while or until) is
included at the end of the loop (after the loop keyword), the block of code is
executed at least once; If the condition is included at the beginning of the loop
(after the do keyword), the condition must evaluate to true for the code to
execute even once.
statements may be placed anywhere in the do... loop
as an alternate way to exit the loop. These can be used as an alternate way to exit
the loop, such as after evaluating a condition mid-loop using an
statement. Exit do statements used within nested do-loop statements will
transfer control to the loop which is one nested level above the loop in which the
exit do occurs.
Examples
86
95
85
85
89