From: lynx.cs.washington.edu!pschwrtz@beaver.cs.washington.edu (Paul Schwartz)
Subject: Re: help with Ada question
Date: 1 Nov 92 09:05:27 GMT [thread overview]
Message-ID: <1992Nov1.090527.29814@beaver.cs.washington.edu> (raw)
robert walker (rwalker@barnacle.micro.umn.edu) wrote:
:
: I could use some help on an Ada question. I have a homework problem
: which states:
:
:
: If neither an exit nor a goto statement were available for Ada, how
: might you simulate the action of an exit statement?
:
:
: This is for a course in higher level languages. We are studying control
: structures of several languages. I have never programmed
: in Ada, and am new to the language.
:
: Thanks for any help in advance.
:
: Robert Walker
: rwalker@mermaid.micro.umn.edu
:
:
The easiest way would be to put the loop in a block and use an
EXCEPTION to get out of the loop. As in;
fooLoop:
BEGIN
LOOP
IF <condition> THEN
RAISE Some_Error;
END IF;
stuff
END LOOP;
EXCEPTION
WHEN Some_Error => NULL; --you just wanted out of the loop
END fooLoop;
--
>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<
Paul Schwartz pschwrtz@lynx.cs.washington.edu
next reply other threads:[~1992-11-01 9:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1992-11-01 9:05 Paul Schwartz [this message]
-- strict thread matches above, loose matches on Subject: below --
1992-11-04 3:11 help with Ada question portal!cup.portal.com!R_Tim_Coslet
1992-10-27 15:47 pa.dec.com!nntpd2.cxo.dec.com!shodha!wallace
1992-10-27 15:31 pa.dec.com!nntpd2.cxo.dec.com!shodha!wallace
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox