Loops through the block of code at least once and then will continue to loop as long as the WHILE condition is TURE.

DO {
    // code to execute for each iteration
} WHILE (condition)

Very similar to WHILE with the exception of checking the condition at the end of each iteration, and not at the beginning. This means that your block of code will always run at least once regardless of the WHILE condition specified, and then at the end, after evaluating the WHILE condition, the DO WHILE decides to continue the loop or not.


$x = 1
DO {
    PRINT "X is" . $x
} WHILE ($x < 10)

Copyright ©2013-2022 SunSed®. All rights reserved.