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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dfe1c08e956f971a X-Google-Attributes: gid103376,public From: Marin David Condic Subject: Re: Reading a text file Date: 2000/10/08 Message-ID: <39E10AEF.440A3523@acm.org>#1/1 X-Deja-AN: 679120251 Content-Transfer-Encoding: 7bit References: <39E09A07.BFF0DA2C@netcourrier.com> X-Accept-Language: en X-Server-Date: 9 Oct 2000 00:02:21 GMT Content-Type: text/plain; charset=us-ascii Organization: Quadrus Corporation Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-10-09T00:02:21+00:00 List-Id: Mathias Dolidon wrote: > Instead of "Read(Data_File, St)" write "Get_Line(Data_File, St)". > >From the ARM 10.1(49) 49. procedure Get_Line(File : in File_Type; Item : out String; Last : out Natural); You've got the right idea, but you will need a "Last" actual parameter, which indicates the last character in the string. BTW, while the exception trap will, in fact, work for detecting EOF, I'd consider it a bit abnormal. EOF is a condition you expect to arrive at sort of like getting to the end of an array with an index. Most people would not terminate an array scanning loop by trapping Constraint_Error, even though it would work. Exceptions are generally considered an indication of some unexpected condition or error. You would not usually use them for "normal" program conditions. MDC -- ====================================================================== Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/ Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m Visit my web site at: http://www.mcondic.com/ "Giving money and power to Government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke ======================================================================