[fpc-devel] Fwd: While - Otherwise Statement
Dmitry Boyarintsev
skalogryz.lists at gmail.com
Mon Oct 12 22:10:07 CEST 2015
On Mon, Oct 12, 2015 at 3:47 PM, <wkitty42 at windstream.net> wrote:
> by checking the value that caused the break ;) deity knows i've done it
> many times before back in the TP/BP 6&7 days... i did it exactly as
> described, too... we had to do it that way as there is/was no other way to
> do it ;)
That's exactly the thing. You didn't have a cross-loop break, that's why
you've to have some guaranteed values that would allow you to verify if a
loop was broken or not.
If it was broken then you'd set any additional conditions (if needed) to
break out another loop and pass it above.
In the end you end-up having additional break condition checks in each
loop. Just by the fact, that a language doesn't provide you with any other
means to do it less complex.
I'd also need to note, that no other language, to my knowledge, have
cross-loop breaks anyway :)
Good-old language (Pascal / C /C++) still have goto though... but we won't
use it, right?
thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20151012/a77029db/attachment.html>
More information about the fpc-devel
mailing list