comp.lang.ada
 help / color / mirror / Atom feed
From: Christoph Grein <christoph.grein@eurocopter.de>
To: comp.lang.ada@ada.eu.org@bulgaria.otn.eurocopter.de
Subject: Re: Extracting Fields in Files
Date: 2000/01/14
Date: 2000-01-14T10:41:49+00:00	[thread overview]
Message-ID: <200001140610.HAA09245@bulgaria.otn.eurocopter.de> (raw)

When you do

 get_line (file => tip0125,
           item => rec01,
           last => rec01_length);

I presume you have defined rec01 (knowing that the maximum record
length is 212) as

  rec01: String (1..212);

Now read very carefully the corresponding chapter in the RM and you'll find
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.









             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 Christoph Grein [this message]
2000-01-14  0:00 ` Extracting Fields in Files jmoor
  -- 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