From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 1 Nov 92 09:05:27 GMT From: lynx.cs.washington.edu!pschwrtz@beaver.cs.washington.edu (Paul Schwartz) Subject: Re: help with Ada question Message-ID: <1992Nov1.090527.29814@beaver.cs.washington.edu> List-Id: 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 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