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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC 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: Stephen Leake Subject: Re: How to detect new line from std_in? Date: 1998/04/16 Message-ID: <3536275F.181E@gsfc.nasa.gov>#1/1 X-Deja-AN: 344695979 Content-Transfer-Encoding: 7bit References: <6h2j74$2se$1@news.tm.net.my> Content-Type: text/plain; charset=us-ascii Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Mime-Version: 1.0 Reply-To: Stephen.Leake@gsfc.nasa.gov Newsgroups: comp.lang.ada Date: 1998-04-16T00:00:00+00:00 List-Id: Centaury wrote: > > 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??) If you are using Ada.Text_IO, there is no "keyword" for the end of line. Text_IO is a line-oriented view of a file; you have to read the file with Get_Line, and keep track of line breaks yourself. If you are reading the file with Stream_IO, then you should see some character(s) representing the line break, but this is operating system (and editor!) dependent. -- - Stephe