[fpc-devel] Fwd: While - Otherwise Statement
Flávio Etrusco
flavio.etrusco at gmail.com
Tue Oct 13 03:34:03 CEST 2015
On Mon, Oct 12, 2015 at 7:15 PM, David W Noon
<david.w.noon at googlemail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Mon, 12 Oct 2015 15:11:18 -0400, Wkitty42 (wkitty42 at windstream.net)
> wrote about "Re: [fpc-devel] Fwd: While - Otherwise Statement" (in
> <561C05D6.4010403 at windstream.net>):
>
>> On 10/12/2015 02:02 PM, Dmitry Boyarintsev wrote:
>>>
>>> The next step would probably be controlled "break", where a user
>>> would be able to specify how many nested loops needed to broken
>>> from.
>
> Hi Mark,
>
> You might have seen me write things like this in the old OS2PROG echo
> of Fidonet some 20+ years ago. ... :-)
>
> The only language I know that offers that level of control is PL/I,
> where the break statement is coded as LEAVE. It is handled by
> labelling the loop control statement and coding the required label in
> the LEAVE statement. For example:
>
> loop_1: DO i = 1 TO m;
> loop_2 : DO j = 1 TO n;
> loop_3: DO k = 1 TO p;
> ...
> IF some_condition THEH
> LEAVE loop_3;[...]
If I'm not missing something, Java implements 'break' just like this.
I'd like such enhancement, but right now is there any reason to avoid
'goto' besides the bad karma?
Regards,
Flávio
More information about the fpc-devel
mailing list