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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,32c37aca7f5cedbb X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-15 15:27:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!207.115.63.138!newscon04.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr14.news.prodigy.com.POSTED!17b0e3b3!not-for-mail User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022 Subject: Re: enumeration_io: get error From: "R. Tim Coslet" Newsgroups: comp.lang.ada Message-ID: References: Mime-version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit NNTP-Posting-Host: 207.214.213.139 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr14.news.prodigy.com 1024180000 ST000 207.214.213.139 (Sat, 15 Jun 2002 18:26:40 EDT) NNTP-Posting-Date: Sat, 15 Jun 2002 18:26:40 EDT Organization: Prodigy Internet http://www.prodigy.com X-UserInfo1: Q[R_PJSCTS@WC\DYAZO\_TDBUKXD@D@MGPW^OBPLAH[\BQUBLNTC@AWZWDXZXQ[K\FFSKCVM@F_N_DOBWVWG__LG@VVOIPLIGX\\BU_B@\P\PFX\B[APHTWAHDCKJF^NHD[YJAZMCY_CWG[SX\Y]^KC\HSZRWSWKGAY_PC[BQ[BXAS\F\\@DMTLFZFUE@\VL Date: Sat, 15 Jun 2002 22:26:40 GMT Xref: archiver1.google.com comp.lang.ada:26043 Date: 2002-06-15T22:26:40+00:00 List-Id: You are getting Storage_Error, because your exception handler (which is handling the Data_Error exception raised by the get when something outside the type is entered) is recursively calling tests. When you have done this enough the stack overflows... One way to handle this would be to use the "goto" in the handler, so that the program iterates rather than recurses. However many people consider "goto" as bad style. A "loop" can also be used, but I'll leave it up to you to figure it out. -- R. Tim Coslet r_tim_coslet@pacbell.net Technology, n. Domesticated natural phenomena. > From: "Gino POLIDO" > Organization: Wanadoo, l'internet avec France Telecom > Newsgroups: comp.lang.ada > Date: Sat, 15 Jun 2002 23:06:16 +0200 > Subject: enumeration_io: get error > > Look at this. If you get "*" or another no alpha numeric character, there is > a loop and it raises a storagr_error. > How to do? > > Thks > > --------------------------------- > package Mytype is > > type Tmytype is (a,b,c); > > end Mytype; > > with Mytype; > with ada.text_io; > > package Enumeration_Tmytype is new > ada.text_io.enumeration_io(Mytype.Tmytype); > > with Mytype; > with Enumeration_Tmytype; > with ada.text_io; > > procedure tests is > input:Mytype.Tmytype; > begin > for i in 1..4 loop > ada.text_io.put("Choose(a,b, or c):"); > enumeration_Tmytype.get(input); > end loop; > > exception > when others => > tests; > end tests; > > >