The What
Description
The do-while loop executes the code within the code block (i.e. between the curly braces) at least one time. If the conditional expression within the while
is true
, then loop back to the do
and repeat evaluating the code in the code block. It will continue looping until the conditional expression is false
.
Parameters
conditional_expression
- The conditional expression which will evaluate to true or false to determine if the loop will continue.
Show It in ActionBasic
Let’s see the do-while
in action by demonstrating some code examples. You will see it compared to the while
loop too.
When was the last time you got out of your chair and stretched? Just saying…
Go DeepPro
Let’s take a deeper look at the do-while
loop instruction. When should you use it?