comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.Leake@gsfc.nasa.gov>
Subject: Re: How to detect new line from std_in?
Date: 1998/04/16
Date: 1998-04-16T00:00:00+00:00	[thread overview]
Message-ID: <3536275F.181E@gsfc.nasa.gov> (raw)
In-Reply-To: 6h2j74$2se$1@news.tm.net.my


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




  reply	other threads:[~1998-04-16  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-15  0:00 How to detect new line from std_in? Centaury
1998-04-16  0:00 ` Stephen Leake [this message]
  -- strict thread matches above, loose matches on Subject: below --
1998-04-17  0:00 Marin David Condic, 561.796.8997, M/S 731-96
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox