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 00:54:26 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!out.nntp.be!propagator-SanJose!in.nntp.be!lackawana.kippona.com!paradoxa.ogoense.net!sn-xit-04!supernews.com!news.airnews.net!cabal10.airnews.net!cabal1.airnews.net!news-f.iadfw.net!usenet From: "John R. Strohm" Newsgroups: comp.lang.ada Subject: Re: FILE IO Error? Date: Wed, 19 Dec 2001 02:24:36 -0800 Organization: Airnews.net! at Internet America Message-ID: <46C4E4AF1E2947D6.C031C44B4DC72DB1.3C8E5CB9537AFF9A@lp.airnews.net> X-Orig-Message-ID: <9vpkgj$fku@library1.airnews.net> References: <3C1FC17F.B47D5CA8@mindspring.com> Abuse-Reports-To: abuse at airmail.net to report improper postings NNTP-Proxy-Relay: library1-aux.airnews.net NNTP-Posting-Time: Wed Dec 19 02:52:35 2001 NNTP-Posting-Host: !^<2$1k-V\rm\r; (Encoded at Airnews!) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:18083 Date: 2001-12-19T02:24:36-08:00 List-Id: Just because you are programming in Ada doesn't mean you can ignore the basics of debugging. Add some text_io.put calls, to see what you're reading. As coded, you appear to be planning on reading PRECISELY 8*(8+1+4) = 104 characters from your file. You appear not to be expecting separators after the second name in record i and the first name in record i+1, and you appear not to be expecting any kind of record breaks. Is this what you were planning on doing? "Ray" wrote in message news:3C1FC17F.B47D5CA8@mindspring.com... > 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; > > -------------------------------------------------------------------------- ---