[fpc-devel] Fwd: While - Otherwise Statement

Sven Barth pascaldragon at googlemail.com
Mon Oct 12 08:06:30 CEST 2015


Am 11.10.2015 23:56 schrieb "Steve Smith" <fski12 at yahoo.com>:
>
> Am I being stupid? It's late here so...
>
> What's wrong with....
>
> === code begin ===
>
> while bool do
>    foo;
> bar;
>
> or
>
> repeat
>    foo;
> until bool;
>
> bar;
>
> === code end ===

You know... You got me there...
Though at least for the while-loop it may have a use if one defines the
then-clause as being executed only if the loop was entered once. Or - using
a different keyword - if the loop was never executed.
The repeat-loop however is always executed at least once, so there it's
completely useless indeed...

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20151012/8d57a7d4/attachment.html>


More information about the fpc-devel mailing list