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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.42.67.19 with SMTP id r19mr7186667ici.6.1386675593247; Tue, 10 Dec 2013 03:39:53 -0800 (PST) X-Received: by 10.182.204.42 with SMTP id kv10mr8220obc.33.1386675593089; Tue, 10 Dec 2013 03:39:53 -0800 (PST) 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!news.bbs-scene.org!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!p15no16843158qaj.0!news-out.google.com!p7ni14196qat.0!nntp.google.com!p15no16843150qaj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 10 Dec 2013 03:39:52 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=109.148.248.100; posting-account=pmkN8QoAAAAtIhXRUfydb0SCISnwaeyg NNTP-Posting-Host: 109.148.248.100 References: <1d445f04-b670-444f-9858-55da271fe17a@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2b6dc37f-4aa6-4c18-be59-8c09f6f37f01@googlegroups.com> Subject: Re: Will Ada-95 Programs Written in MS Windows Run in MacOS and Linux Without Some Tweaking. From: Austin Obyrne Injection-Date: Tue, 10 Dec 2013 11:39:53 +0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:17930 Date: 2013-12-10T03:39:52-08:00 List-Id: On Tuesday, December 10, 2013 6:37:28 AM UTC, Randy Brukardt wrote: > "Simon Wright" wrote in message news:lywqjf45za.fsf@= pushface.org... ... > and as far as I can tell this was caused by the Windo= ws line > terminator[2] in the data file; that's to say, when I removed the= CR > character from the Windows CR/LF the program decoded correctly. > > I= 'm not sure of the best way to get an Ada program not to care what sort > o= f input line terminators it's reading. I'm surprised that that would be a p= roblem, at least for Unix and Windows files. It's pretty simple to design T= ext_IO so that it can read either properly; that's how Text_IO in Janus/Ada= works. (The only difference for it between Windows and Unix versions is th= e characters output by New_Line). Of course, such a Text_IO would make a re= al hash out of old Mac files. (I usually use an Ada program to convert text= files to Windows format; it's just a simple loop of Get_Line/Put_Line pair= s.) But if you don't want to change the terminators (or your compiler has a= n unnecessarily inflexible Text_IO), I'd suggest using Stream_IO. Of course= , then you'll have to do your own buffering of input (but that's usually a = good idea anyway). Randy. Hi Randy, May I chip in with this layman=92s suggestion however daft it may seem to y= ou guys (all my Ada has been learned by teasing out mechanical models that = I invented and conjecture as being Ada syntax errors eliminating them one b= y one until it is compiled and built ok). =20 *I am in Ada just for one solitary piece of problem solving i.e. the implem= entation of my ciphers in a programming language that I like so here goes. I don't anything about what's under the bonnet of the Ada Rolls Royce. Please consider this procedure in the program that gave trouble, This is the defacto stripped down procedure EXIT when EOF; EXIT when EOL; FOR I IN 1 .. 3 LOOP Ada.Integer_Text_IO.Get(File =3D> InData, Item =3D> W(I)); --Ada.Integer_Text_IO.Put(Item =3D> W(I), Width =3D> 8); END LOOP; LOOP; LOOP; The EOF marker on my computer is the right arrow =3D> (element number 26 in= Latin-1) I don=92t know what EOL is (yet) Could it be that the 'FOR' loop is somehow getting out of sync with EOL ???= ? i.e. not being completed at the computer-perceived EOL ??? Fools rush in =85.. Regards=20 Austin - adacrypt