Statement: do .. loop
A do statements ... loop statement runs the statements in between until a 'while condition' or 'until condition' sub-statement causes the loop to exit. Currently the maximum number of iterations is fixed 1000.
If a 'while condition' sub-statement is encountered and the condition is false, the execution of the script moves to the first statement after the 'loop' keyword. Encountering an 'until condition' sub-statement breaks out of the loop if the condition is true.
do Statement Format |
---|
do statements ... while bool_expr statements ... until bool_expr statements ... loop |
do Statement | |
---|---|
Example | Output |
let day = @date.g:dmy("1apr2017"); do write @text."g:wdmy+"(day) nl; until day >= @date.g:dmy("1may2017"); day += 7; loop |
Saturday 1 April 2017 Saturday 8 April 2017 Saturday 15 April 2017 Saturday 22 April 2017 Saturday 29 April 2017 Saturday 6 May 2017 |