From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=BAYES_05,MSGID_SHORT autolearn=no autolearn_force=no version=3.4.5-pre1 Date: 7 Feb 93 00:28:00 GMT From: ucsbcsl!lemon.ucsb.edu@ucbvax.Berkeley.EDU (Maxwell Lee) Subject: question about the fate of input stream after DATA_ERROR Message-ID: <7600@ucsbcsl.ucsb.edu> List-Id: Hi, I have some ADA code which produces a strange result I can't understand why. I'm wondering if someone out there in ADA-land can help me. I have the following code: type OPCODE is (I, S, Q, X); CODE: OPCODE; ------------------------------------------------- (in my main program) with TEXT_IO; use TEXT_IO; with INTEGER_IO; use INTEGER_IO; package OPCODE_IO is new ENUMERATION_IO(OPCODE); use OPCODE_IO; -------------------------------------------------- I simply want to perform a GET(CODE); from standard-input. When I enter an "i", "s", "q", "x", "I", "S", "Q", or "X" the command works fine. When I enter a number, say "1", a DATA_ERROR is raised, but the "1" is left in the input stream (input buffer). When I enter a character that's not an OPCODE, say an "m", a DATA_ERROR is raised, but the "m" is removed from the input stream (input buffer) !!! I understand why both a "1" or an "m" will produce DATA_ERROR, but I don't understand why "1" will be left in the input stream, but "m" will be removed from the input stream. I assumed that in both cases it would be left in the input stream. Can someone help me? Thank you. ********************************************************************** "Mongo don't know .... Mongo only pawn in game of life." (From the movie "Blazing Saddles") maxwell@cs.ucsb.edu **********************************************************************