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.1 required=5.0 tests=AXB_XMAILER_MIMEOLE_OL_024C2, BAYES_00,MAILING_LIST_MULTI,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cbb87dd49168c396 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-29 12:56:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!freenix!enst.fr!not-for-mail From: "David C. Hoos" Newsgroups: comp.lang.ada Subject: Re: Get_Line Date: Tue, 29 Oct 2002 14:55:24 -0600 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1035924962 40572 137.194.161.2 (29 Oct 2002 20:56:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Tue, 29 Oct 2002 20:56:02 +0000 (UTC) Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.13 Precedence: bulk List-Unsubscribe: , List-Id: comp.lang.ada mail<->news gateway List-Post: List-Help: List-Subscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Original-Cc: jbirtwell@yahoo.com Xref: archiver1.google.com comp.lang.ada:30203 Date: 2002-10-29T14:55:24-06:00 What you're calling the "command line" is _not_ the command line once your program starts. It's the standard-input file, unless you've called Ada.Text_IO.Set_Output to set it to something else. So.. yes, you are reading from a file. ----- Original Message ----- From: "Justin Birtwell" Newsgroups: comp.lang.ada To: Sent: Tuesday, October 29, 2002 2:24 PM Subject: Get_Line > Hi, > > I'm having some strange behavior with Get_Line. In a procedure called > GetData I call Get_Line to receive input from the command line. The first > time this function is called it behaves fine prompting the user for input. > The second time it runs the execution passes through Get_Line and no prompt > appears on the command line. Upon doing a little research in the Ref Man. > I found a statement that talks about if Get_Line finds a line terminator it > automatically returns. But how can this be? Here's the statement from the > RM. > > << A string read by Get or written by Put can extend over several lines. An > implementation is allowed to assume that certain external files do not > contain page terminators, in which case Get_Line and Skip_Line can return as > soon as a line terminator is read. >> > > But I'm not reading from a file? I'm reading from the command line? Does > anyone understand this behavior? > > Sincerely, > Justin > > P.s. Here's a few statements leading up to the problem... > > procedure Getdata(P_Num_Of_Points: out Natural) is > Last:Natural:=0; > Buffer:String(1..80):=(1..80=>Character'val(0)); > l_Num:Integer; > --Answer:Character; > begin > > --get input > --are there any invalid characters > --is it a valid number anyway? > --does the user want to use this number? > Ada.Text_Io.Put_Line("Enter between 1 and 6 Balloons to create in > the box. "); > loop > begin > > ---This line gets skipped > returning with an empty buffer!!!!!!! > if Jb.Stringfunctions.Is_Integer(Buffer(Buffer'First..Last)) then > > > > > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada >