Loops/Do-while: Difference between revisions

Content added Content deleted
m ({{omit from|GUISS}})
No edit summary
Line 476: Line 476:
} while (x % 6 != 0)</lang>
} while (x % 6 != 0)</lang>


=={{header|Objeck}}==
=={{header|NetRexx}}==
In NetRexx the '''do&ndash;while''' construct is implemented via the <code>until ''expru''</code> conditional clause of the <code>loop</code> instruction. The expression ''expru'' in the <code>until ''expru''</code> clause is evaluated at the end of the loop, guaranteeing that the loop will be executed at least once.
<lang objeck>
<lang NetRexx>/* NetRexx */
i := 0;
options replace format comments java crossref savelog symbols nobinary
do {

i->PrintLine();
say
i += 1;
say 'Loops/Do-while'
}

while (i % 6 <> 0);
i_ = 0
loop until i_ // 6 = 0
i_ = i_ + 1
say i_
end
</lang>
</lang>


Line 495: Line 500:
in
in
loop 0</lang>
loop 0</lang>

=={{header|Objeck}}==
<lang objeck>
i := 0;
do {
i->PrintLine();
i += 1;
}
while (i % 6 <> 0);
</lang>


or implementing a generic do-while iterator with higher order function:
or implementing a generic do-while iterator with higher order function: