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,176cc435d3b6eb0f X-Google-Attributes: gid103376,public From: "Marin David Condic, 561.796.8997, M/S 731-96" Subject: Re: How to detect new line from std_in? Date: 1998/04/17 Message-ID: <98041710220850@psavax.pwfl.com>#1/1 X-Deja-AN: 345045609 Sender: Ada programming language Comments: To: utopian@tm.net.my X-VMS-To: SMTP%"INFO-ADA@VM1.NODAK.EDU" X-VMS-Cc: SMTP%"utopian@TM.NET.MY",CONDIC Newsgroups: comp.lang.ada Date: 1998-04-17T00:00:00+00:00 List-Id: Centaury writes: >I'm writing a program that reads text from std_in whether by keyboard entry >or file redirection. >If I have something that looks like this; > >harlooo and welcome to >the greatest circus > >my program would only recognise that there is 6 words, instead of 7. This is >because to and the are joined together and become tothe as the data in my >linked list. > >What is the keyword to detect new line (or is it something else??) > It sounds like you are reading the input a byte at a time with the "Get" procedure and, given its semantics, it bypasses the end of line marker and starts at the next line of input. You should take a serious look at the package Ada.Text_IO. It might suggest easier ways to do this, such as reading in a whole line at a time and concatenating lines if you want to process the input as a character at a time. But, given that you want to look at it a character at a time, you will want to look up these functions in Ada.Text_IO: End_Of_Line, End_Of_Page and End_Of_File. If you're reading a character at a time, you probably need to look at all these functions to know when to stop. MDC Marin David Condic, Senior Computer Engineer Voice: 561.796.8997 Pratt & Whitney GESP, M/S 731-95, P.O.B. 109600 Fax: 561.796.4669 West Palm Beach, FL, 33410-9600 Internet: CONDICMA@PWFL.COM ============================================================================= "Because that's where they keep the money." -- Willie Sutton when asked why he robbed banks. =============================================================================