TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mike Kamrad <[log in to unmask]>
Reply To:
Mike Kamrad <[log in to unmask]>
Date:
Sat, 21 Mar 1998 18:06:56 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (36 lines)
At 12:00 PM 3/20/98 -0700, [log in to unmask] wrote:
>There is a way to simulate Continue without using any Goto:
>
>   Any_Loop:
>      loop
>         Continue_Loop:
>            loop
>               -- this loop is not a real one.
>               -- it is not eexecuted more than once at a time.
>               ...
>               -- Continue
>               exit Continue_Loop;
>               ...
>               exit Continue_Loop;
>            end loop Continue_Loop;
>       end loop Any_Loop;
>
>I agree it is rather ugly, but at least for those that are prohibited from
>using Gotos, they can simulate Continue; and the efficiency should be quite
>good.
>
>-- Vincent

Vincent,

I thought of this one too as an alternative to the goto but I thought it
was uglier and muddles the intent of the exit.  The goto to a null last
statement of the loop makes the intent more clear...mike

------------------------------------------------------
Mike Kamrad                             [log in to unmask]
BlazeNet                                1.508.370.4343 x139
Suite 300                               1.508.370.4344 FAX
1671 Worcester Road
Framingham MA 01701

ATOM RSS1 RSS2