From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,deeb88b0e7eede4f X-Google-Attributes: gid103376,public From: Dave Jones Subject: Re: Help with Exceptions! Date: 1996/05/13 Message-ID: <319764DA.3A8C@io.com>#1/1 X-Deja-AN: 154587332 references: <4mmimq$s4r@hatathli.csulb.edu> <318F94D9.35AB@io.com> <31935435.3C00@mmc1001.lfwc.lockheed.com> cc: davedave@io.com content-type: text/plain; charset=us-ascii organization: PSI Public Usenet Link mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.01 (Win16; I) Date: 1996-05-13T00:00:00+00:00 List-Id: George F.Rice wrote: > > Dave Jones wrote: > > : procedure test is > : x:integer ; > : begin > : begin > : x := 10000000 ; > : exception > : when CONSTRAINT_ERROR => > : goto Next_Block ; > : end ; > : <> > : begin > : x := 3 ; > : exception > : when CONSTRAINT_ERROR => > : RETURN ; > : end ; > : RETURN ; > : end test; > > The goto is unnecessary; when the exception handler completes, > control will pass to the next statement anyway. > That's very true. I was just trying to show what could be done with regard to jumping out of a block where an exception has occured. In any case, like I said in my post, I don't recommed this way of approaching the problem. In fact, I actually regret making that post because, every time I have seen an Ada program with a "goto", I have always been able to find a better way to write the program; so I suppose that I really should not be gently encouraging people to use "goto". Most others seem to have an experience similar to mine: "goto" means you need to change your approach. So I was wondering, has anyone out there ever encountered a situation where "goto" was actually necessary? -- Dave Jones