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=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,eee47022b0e39dbb X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: Exception problem Date: 1997/02/19 Message-ID: <01bc1e5e$a43929a0$148c71a5@dhoossr.iquest.com>#1/1 X-Deja-AN: 219828297 Distribution: world References: <330A0D25.313@fs2.assist.uci.edu> Content-Type: text/plain; charset=ISO-8859-1 Organization: Ada95 Press, Inc. Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1997-02-19T00:00:00+00:00 List-Id: The problem is that when Text_IO.Data_Error is raised in this circumstance, the pointer in the input stream is backed up to where it was before the Int_IO.Get was called. Therefore, if you want to skip over this non-numeric data in the input stream, you should call Text_IO.Skip_Line just after the line: Put_Line ("Entry must be a number. Try again."); Incidentally, Ada is much more civilized than C++. We don't "throw" things. Exceptions are simply "raised." One other point about your code. Instantiations of generics (e.g., Text_IO.Integer_IO) for commonly used types are better placed at the Library level, so all parts of your program can use the same instantiation. Depending on the compiler/binder/linker used, code for multiple identical instantations may or may not share the code. -- David C. Hoos, Sr., http://www.dbhwww.com http://www.ada95.com Larry Coon wrote in article <330A0D25.313@fs2.assist.uci.edu>... > Ada beginner here... > > The intent of the following code is to loop until valid input is > provided: >