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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!reality.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: I am not understanding user defined exceptions Date: Fri, 3 Feb 2017 15:08:31 -0600 Organization: JSA Research & Innovation Message-ID: References: <6cb6e781-c6df-4962-99e3-760e7c7fab88@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: franka.jacob-sparre.dk 1486156111 27390 24.196.82.226 (3 Feb 2017 21:08:31 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 3 Feb 2017 21:08:31 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:33233 Date: 2017-02-03T15:08:31-06:00 List-Id: wrote in message news:6cb6e781-c6df-4962-99e3-760e7c7fab88@googlegroups.com... > Hi Everyone > > I am not understanding user defined exceptions. This little program will > ask the user for integer entry twice. If I type 1 at the first entry, > things work as expected and the exception is handled. > > However if I type, 2 and then 1, an exception is not raised at the second > text_io.get. > > If we type something like : > if x = 1 > then > raise Foo_Error; > end if ; > > will x not be tested for exceptions conditions automatically from that > point onward? No. Why would you think so? The above is just normal code that is executed when it is encountered in the statement stream. It doesn't have any magic properties. Randy.