comp.lang.ada
 help / color / mirror / Atom feed
From: jmoor@my-deja.com
Subject: Re: Extracting Fields in Files
Date: 2000/01/14
Date: 2000-01-14T00:00:00+00:00	[thread overview]
Message-ID: <85nfks$be$1@nnrp1.deja.com> (raw)
In-Reply-To: 200001140610.HAA09245@bulgaria.otn.eurocopter.de

In article <200001140610.HAA09245@bulgaria.otn.eurocopter.de>,
  comp.lang.ada@ada.eu.org wrote:
> that reading exactly 212 characters will leave the LF (the end of
line on
> Unix, i.e. end of record, as you call it) unread. So your next
get_line simply
> reads the LF and returns an empty line.
>
> As a simple work-around declare
>
>   rec01: String (1..213);
>
> (one longer than the maximum expected length) and a get_line will
always
> swallow the LF.
>
>

I increased the length of the rec01 string to 213 as you suggested.  I
printed a report showing record number, type, and length returned from
get_line and that program modification did stop get_line from returning
an empty line.

The report also showed that record 193 was an inappropriate length for
the type (in Cobolese "wrong length record").  The program prematurely
goes to end of job after reading record 193.  Wouldn't you think that
an exception would have been raised?  Even if I wrote a routine that
trapped "wrong length records" how could I bypass the "record"?  Did
the program stop after reading the record because it truly sensed an
end of file condition or because it sensed an exception?

Learning a new language is not easy (esp. for old dogs).


Sent via Deja.com http://www.deja.com/
Before you buy.




  reply	other threads:[~2000-01-14  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-14  0:00 Extracting Fields in Files Christoph Grein
2000-01-14  0:00 ` jmoor [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-01-13  0:00 Christoph Grein
2000-01-13  0:00 ` jmoor
2000-01-13  0:00   ` David C. Hoos, Sr.
2000-01-14  0:00     ` jmoor
2000-01-14  0:00       ` Ted Dennison
2000-01-15  0:00       ` Gautier
2000-01-12  0:00 jmoor
replies disabled

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