comp.lang.ada
 help / color / mirror / Atom feed
From: Ray <yarzepol@mindspring.com>
Subject: FILE IO Error?
Date: Tue, 18 Dec 2001 22:21:51 GMT
Date: 2001-12-18T22:21:51+00:00	[thread overview]
Message-ID: <3C1FC17F.B47D5CA8@mindspring.com> (raw)

I am reading in some data from a file and despite reading in the data
successfully, I get this ADA.IO_EXCEPTIONS'CHILD_UNIT.END_ERROR which
means I am trying to read past the EOF.  Can someone explain why I get
this error or what I am not seeing?

thanks,

Ray

  
-----------------------------------------------------------------------------
   PROCEDURE load_data IS

      data_file : file_type;
      value : character;

   BEGIN

      open (data_file, in_file, "file.dat");

      IF NOT end_of_file (data_file) THEN
         FOR i IN 1 .. 8 LOOP

            -- Read in 8 character name.
            FOR j IN 1 .. 8 LOOP
               get (data_file, value);
               label_1 (i) (j) := value;
            END LOOP;

            -- Eat delimiter character.
            get (data_file, value);

            -- Read in 4 character name.
            FOR j IN 1 .. 4 LOOP
               get (data_file, value);
               label_2 (i) (j) := value;
            END LOOP;

         END LOOP;
      END IF;

      close (data_file);

   END load_data;
  
-----------------------------------------------------------------------------



             reply	other threads:[~2001-12-18 22:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-18 22:21 Ray [this message]
2001-12-19 10:24 ` FILE IO Error? John R. Strohm
2001-12-19 10:25 ` Preben Randhol
replies disabled

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