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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,86c750b8474bf6d5 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!news.glorb.com!feeder.erje.net!newsfeed.kamp.net!newsfeed.kamp.net!feeder.news-service.com!ramfeed2.eweka.nl!eweka.nl!hq-usenetpeers.eweka.nl!69.16.177.246.MISMATCH!cyclone03.ams!news.ams.newshosting.com!npeersf01.ams!newsfe13.ams2.POSTED!53ab2750!not-for-mail From: Chris Moore User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: About String References: <484ABED3.8040909@obry.net> In-Reply-To: <484ABED3.8040909@obry.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: NNTP-Posting-Host: 82.18.136.196 X-Complaints-To: http://netreport.virginmedia.com X-Trace: newsfe13.ams2 1212876788 82.18.136.196 (Sat, 07 Jun 2008 18:13:08 EDT) NNTP-Posting-Date: Sat, 07 Jun 2008 18:13:08 EDT Organization: virginmedia.com Date: Sat, 07 Jun 2008 23:13:16 +0100 Xref: g2news1.google.com comp.lang.ada:603 Date: 2008-06-07T23:13:16+01:00 List-Id: Pascal Obry wrote: > Simon Wright a �crit : >> You might want to handle the problem locally: >> >> procedure Patati_Patata is >> begin >> declare >> S : String := A_Function_Raising_Constraint_Error; >> begin >> -- some code >> exception >> when Constraint_Error => >> -- deal with the problem and carry on .. >> end; >> -- .. here > > This one is wrong. The exception on the declare section can't be handled > on the local block as it will raised outside of the block. > > Pascal. > You are correct. I have to say this is an entirely non-intuitive "feature" of the language. We talk about declare blocks and yet the scope of the exception handlers doesn't include the declarations! And the OP is correct in noticing that without the inner declare block exceptions raised in the outermost declarative section leak into the calling subprogram. Ugh. Chris