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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d54559bde05f5bb8 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!newsfeed.straub-nv.de!news.germany.com!news.teledata-fn.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Weird string I/O problem Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1316b4ad-bdd9-4a1f-82d5-07231e6872af@s20g2000yqh.googlegroups.com> Date: Wed, 26 Nov 2008 09:25:19 +0100 Message-ID: <1sr39d4v1hgxy$.u9da4qgbl1rp.dlg@40tude.net> NNTP-Posting-Date: 26 Nov 2008 09:25:16 CET NNTP-Posting-Host: 69bd491e.newsspool1.arcor-online.net X-Trace: DXC=5dc``JSX\i9Tia]Ho99G50ic==]BZ:af>4Fo<]lROoR1^YC2XCjHcb9H1H@Tml5BLkg219\T? On Tue, 25 Nov 2008 23:38:04 -0800 (PST), christoph.grein@eurocopter.com wrote: > I meant > Here, Get_Line consumes the rest of the previous input up to and > including the , in your case the rest is empty. > (If you had entered 12.3 xxx, the contents of UBS would be > " xxx".) And a little advise for text processing: 1. Never read data items directly from files. Do lines first, as strings. Then parse obtained strings. 2. Take care to remove trailing LF and CR at the line end. (You never know if the text file do obey UNIX or MS-DOS conventions.) 3. Always verify that the whole line was parsed. 4. Do not use Unbounded_String, it is just an unnecessary overhead. Ada 2005 has Get_Line returning String. (In high-integrity software use Ada 95's Get_Line, that with the line size limited). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de