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.
Your functions are bloated. Put them on a diet. Think "skinny" and "as few lines as possible."
Go DeepPro
Let’s take a deeper look at the do-while
loop instruction. When should you use it?