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-Thread: 103376,7728b533f7ab5fb6 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!news.glorb.com!feeder.erje.net!news.ecp.fr!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: Avoiding side effects Date: Tue, 30 Sep 2008 09:48:56 +0200 Organization: Adalog Message-ID: References: NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1222756283 16964 195.25.228.57 (30 Sep 2008 06:31:23 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Tue, 30 Sep 2008 06:31:23 +0000 (UTC) User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) In-Reply-To: Xref: g2news1.google.com comp.lang.ada:2153 Date: 2008-09-30T09:48:56+02:00 List-Id: Anders Wirzenius a �crit : [...] > The problem is how to deal with the situation when I reach the > end of the file. > I have done it using a side effect: > EOF_Reached : Boolean := False; > loop > Trans_String... > exit when EOF_Reached; > Trans_String... > exit when EOF_Reached; > end loop; > -- Display possible tail of file A. > EOF_Reached is set to True in the functions Strip and Advance as > a side effect. > > Is there a better way without using the side effect EOF_Reached? > Exceptions of course! -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr