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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9797292c79ff60c X-Google-Attributes: gid103376,public From: "John J Cupak Jr, CCP" Subject: Re: Help: Get/Get_line Date: 1998/05/21 Message-ID: <35645664.2AE1A75A@swl.msd.ray.com>#1/1 X-Deja-AN: 355359114 References: <355E0DE6.6867@info.polymtl.ca> <356231EB.3F2@eurocopter.de> Content-Type: multipart/mixed; boundary="------------F60338C9BEC13D58B1FCB79C" Organization: Raytheon Systems Company, SEL Training Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-05-21T00:00:00+00:00 List-Id: This is a multi-part message in MIME format. --------------F60338C9BEC13D58B1FCB79C Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Christoph Grein has pointed out the problem with using Get to read an Integer number from the input stream, as opposed to using Get_Line to read the entire line. In the Ada classes I teach, I recommend that the students use Skip_Line to ignore everything after the initial input: Get(Number); -- Read Integer number Skip_Line; -- Discard remainder of input buffer Alternatively, if you use Get_Line(Line, Size) to read in the entire line, then you can use the Integer Get from a string to extract just the integer part (See RM A.10.8(15-16)): Get_Line(Line, Size); Get(From => Line(1..Size), Item => Number, Last => Last); Hope this helps! (And that I didn't make any misteaks!) -- -------------------------------------------------------------- - John J. Cupak Jr, CCP - - Raytheon Systems Company - Software Engineering Laboratory - - tel: 978-858-1222 email (work): jcj@swl.msd.ray.com - - fax: 978-858-4336 email (home): jcupak@aol.com - -------------------------------------------------------------- --------------F60338C9BEC13D58B1FCB79C Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Cupak Jr, CCP, John J. Content-Disposition: attachment; filename="vcard.vcf" begin: vcard fn: John J. Cupak Jr, CCP n: Cupak Jr, CCP;John J. org: Raytheon System Company / SEL Training adr;dom: 50 Apple Hill Road;;MS T3MN35;Tewksbury;MA;01879; email;internet: jcj@swl.msd.ray.com title: Senior Software Engineer / Instructor tel;work: 978-858-1222 tel;fax: 978-858-4336 tel;home: 603-595-8240 note: EMAIL;AOL:jcupak@aol.com x-mozilla-cpt: ;0 x-mozilla-html: TRUE version: 2.1 end: vcard --------------F60338C9BEC13D58B1FCB79C--