Purpose | The do ... until statement is used to loop repeatedly until a condition is true. At each iteration of the loop some Superx++ statements can be executed. | |||||
Format |
do { {iteration statements} } until({loop condition}); {iteration statements} |
the statements to be executed with each iteration of the loop. |
{loop condition} |
the condition to be evaluated: if false then the loop will continue; if true then the loop will terminate. |
|
|
Example #1 |
class XEmployee { public: int MyCount = 0; }; node(XEmployee) MyEmp; do { xout("\r\nDo ... Until\tinstance = " + MyEmp.MyCount); MyEmp.MyCount = MyEmp.MyCount + 1; } until(10 >= MyEmp.MyCount);
The loop starts execution with the {iteration statements} and then executes the until clause to see whether or not it should continue processing. In this case the following text is sent to the output stream: |