Siebel eScript Language Reference > Siebel eScript Language Overview > Siebel eScript Statements >
do...while Statement
The do...while statement processes a block of statements until a specified condition is met. Syntax
do { statement_block; } while (condition)
|
|
statement_block |
One or more statements to be executed within the loop |
condition |
An expression indicating the circumstances under which the loop should be repeated |
Usage
The do statement processes the statement_block repeatedly until condition is met. Because condition appears at the end of the loop, condition is tested for only after the loop executes. For this reason, a do...while loop is always executed at least one time before condition is checked. Example
This example increments a value and prints the new value to the screen until the value reaches 100. var value = 0; do { value++; Clib.sprintf(value); } while( value < 100 );
See Also
for Statement while Statement
|