Do Until Loop
From Sputnik Wiki
(Difference between revisions)
(Created page with "= Do Until = === Description === Loop based on an expression. <pre> Do { statements ... }Until ( <expression> ) </pre> === Parameters === ==== expression ==== If t...") |
(→expression) |
||
Line 18: | Line 18: | ||
If the expression is false the following statements are executed. This loop continues until the expression is true. | If the expression is false the following statements are executed. This loop continues until the expression is true. | ||
+ | |||
+ | Same as a WHILE you can omit the expression however this loop will only execute once if you do that. | ||
=== Remarks === | === Remarks === |
Revision as of 12:35, 30 September 2013
Contents |
Do Until
Description
Loop based on an expression.
Do { statements ... }Until ( <expression> )
Parameters
expression
If the expression is false the following statements are executed. This loop continues until the expression is true.
Same as a WHILE you can omit the expression however this loop will only execute once if you do that.
Remarks
Do Until statements may be nested.
The expression is NOT tested before the loop is executed so the loop will be executed one or more times.
To create an infinite loop, you can use a non-zero number as the expression such as "Until (False)"
The expression can contain the boolean operators of &&, ||, ! as well as the logical operators <, <=, >, >=, ==, !=, <>, eq, eqi, neq and neqi as needed grouped with parentheses as needed.
Example
$i = 0; Do { println( "Value is: " . $i ); $i++; }Until ( $i > 20 )