comp.lang.ada
 help / color / mirror / Atom feed
From: jmoor@my-deja.com
Subject: Extracting Fields in Files
Date: 2000/01/12
Date: 2000-01-12T00:00:00+00:00	[thread overview]
Message-ID: <85hu94$tk3$1@nnrp1.deja.com> (raw)

I am reading a file containing variable length records, the maximum
size being 250 bytes and the minimum size 5 bytes.

I read each record by doing the following:

While not end_of_file(tip0125) loop
  Get_line (tip0125,rec01,rec01_length);
  .
  .

                METHOD 1
I break the individual fields up by doing the following:

Command_code := rec01(073..077);
Date_entered := rec01(001..008);
.
.
.

                METHOD 2
After writing the program, I bought an Ada book (Bad timing. I should
have bought the book before writing the program) that said that the
individual fields should be broken up by using the "text_io.get" on
each field.


Is it inherently wrong to use METHOD 1 to break up individual fields
instead of METHOD 2. I am experiencing problems with ignoring some
records, but I would doubt that METHOD 1 is the culprit.


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




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

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-12  0:00 jmoor [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-01-13  0:00 Extracting Fields in Files 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-14  0:00 Christoph Grein
2000-01-14  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