From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,76e94160688627d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-19 02:25:22 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!128.39.3.168!uninett.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: FILE IO Error? Date: Wed, 19 Dec 2001 10:25:21 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: <3C1FC17F.B47D5CA8@mindspring.com> NNTP-Posting-Host: kiuk0156.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1008757521 10984 129.241.83.82 (19 Dec 2001 10:25:21 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Wed, 19 Dec 2001 10:25:21 +0000 (UTC) User-Agent: slrn/0.9.7.3 (Linux) Xref: archiver1.google.com comp.lang.ada:18085 Date: 2001-12-19T10:25:21+00:00 List-Id: On Tue, 18 Dec 2001 22:21:51 GMT, Ray wrote: > 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? Put in a couple of Put_Line that prints out what you read and I guess you should see it. > open (data_file, in_file, "file.dat"); > > IF NOT end_of_file (data_file) THEN Why do you have the IF NOT above? > 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); This looks like a point where errors can occur. > > -- 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; I would recommend as other has said to use Get_Line and then use Get on this to get the values. Preben -- () Join the worldwide campaign to protect fundamental human rights. '||} {||' http://www.amnesty.org/