comp.lang.ada
 help / color / mirror / Atom feed
From: Pascal Obry <p.obry@wanadoo.fr>
Subject: Re: control breaks in ada?
Date: 08 Jun 2002 10:11:17 +0200
Date: 2002-06-08T08:11:15+00:00	[thread overview]
Message-ID: <usn3yyyu2.fsf@wanadoo.fr> (raw)
In-Reply-To: TIBUf1tmGdsy@eisner.encompasserve.org


Kilgallen@SpamCop.net (Larry Kilgallen) writes:

> In article <hK6M8.200852$xS2.15380347@news1.calgary.shaw.ca>, "tr4ck" <tr4ck@rediffmail.com> writes:
> > Hi, can someone give me an example of control breaks in ada?
> 
> Sure, just tell us what a "control break" is.

Maybe the break/continue with C. In this case:

   while (1) {
      if (xyz) break;
   }

is in Ada:

   loop
        exit when xyz;
   end loop;

For readability (if the loop is big) you can name this loop:

   Search_Name : loop
      ...
      exit Search_Name when xyz;
      ...
   end loop Search_Name;

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



  parent reply	other threads:[~2002-06-08  8:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-07 18:14 control breaks in ada? tr4ck
2002-06-07 19:15 ` Larry Kilgallen
2002-06-07 18:37   ` sk
2002-06-08  3:41     ` Eric G. Miller
2002-06-08  9:51       ` sk
2002-06-08  8:06   ` Michal Nowak
2002-06-08  8:11   ` Pascal Obry [this message]
2002-06-08 10:00 ` sk
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox