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.1 required=5.0 tests=BAYES_05,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!newsfeed1.swip.net!news.astraweb.com!border6.a.newsrouter.astraweb.com!cyclone01.ams2.highwinds-media.com!news.highwinds-media.com!voer-me.highwinds-media.com!peer01.am1!peering.am1!npeersf04.am4!fx17.fr7.POSTED!not-for-mail Message-ID: From: Mike H Reply-To: Mike Hopkins Newsgroups: comp.lang.ada Subject: Re: Reading data from file References: <9b780534-04fb-43c8-b8de-1610421c471d@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain;charset=us-ascii;format=flowed User-Agent: Turnpike/6.07-M (<8h3$+H9w77fbG5diUKzNqJYcPG>) NNTP-Posting-Host: 83.104.138.185 X-Complaints-To: abuse@demon.net X-Trace: 1394028567 83.104.138.185 (Wed, 05 Mar 2014 14:09:27 UTC) NNTP-Posting-Date: Wed, 05 Mar 2014 14:09:27 UTC Date: Wed, 5 Mar 2014 13:59:43 +0000 X-Received-Body-CRC: 1513272773 X-Received-Bytes: 1943 Xref: news.eternal-september.org comp.lang.ada:18782 Date: 2014-03-05T13:59:43+00:00 List-Id: In message <9b780534-04fb-43c8-b8de-1610421c471d@googlegroups.com>, Laurent writes >Here is my code. It compiles but it isn't complete. From what I see of your code so far, it is going to fail if any of the data in the input file is corrupt. Do not take that as a criticism because, depending upon the requirements as set out in the exercise you are attempting, it may be quite acceptable. In which case you have nothing to worry about. But in the real world corrupt data is an inevitability. If you don't believe me, try putting a non-numeric character in the "ID" line. By it's very nature, corrupt data is chaotic. Trapping and reporting such errors and then recovering from that situation and dealing with further data (whether corrupt or not) takes a certain amount of skill. It also involves writing a considerable amount of code, which by definition, one hope will never need to be executed. -- Time flies like an arrow. Fruit flies like a banana. Mike