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-Thread: 103376,d54559bde05f5bb8 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!postnews.google.com!a3g2000prm.googlegroups.com!not-for-mail From: Jerry Newsgroups: comp.lang.ada Subject: Re: Weird string I/O problem Date: Wed, 26 Nov 2008 20:46:10 -0800 (PST) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 75.171.118.178 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1227761170 9578 127.0.0.1 (27 Nov 2008 04:46:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 27 Nov 2008 04:46:10 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a3g2000prm.googlegroups.com; posting-host=75.171.118.178; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US) AppleWebKit/525.18 (KHTML, like Gecko, Safari/525.20) OmniWeb/v622.3.0.105198,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:2820 Date: 2008-11-26T20:46:10-08:00 List-Id: On Nov 25, 10:52 pm, Jerry wrote: > The following program misbehaves if the line ... > Jerry Thanks for all the help, everyone. Making Skip_Line or Set_Col(Current_Input, 1) the first line of my Get_Line works--Set_Col looks a little more general, so I'll use it. I now see that Ada 2005 has a Get_Line returning Unbounded_String: http://www.adaic.org/standards/05rat/html/Rat-7-5.html However, it does not solve my problem because it, too, reads the "dangling" line terminator which is left over from the Get on a Float. And--I can't do anything about it (such as adding Set_Col) unless of course I want to edit the source and thus subvert the intentions of the smart people who figured all of this out. So my problem is solved, but I'm still puzzled. All I'm trying to is to very simple IO from keyboard and monitor to enter e.g. a numeric parameter into my program as well as, say, a file name. So any Get on a Float followed by any of the Get_Line routines will raise this problem. It just seems odd to me that for such a simple application, I have to remember to clear the dangling line terminator after the Get on a Float. (Or, in the present case, since I have easy access to the code, to have the Get_Line do it for me.) Thanks, Jerry