comp.lang.ada
 help / color / mirror / Atom feed
From: Austin Obyrne <austin.obyrne@hotmail.com>
Subject: Re: Will Ada-95 Programs Written in MS Windows Run in MacOS and Linux Without Some Tweaking.
Date: Tue, 10 Dec 2013 03:39:52 -0800 (PST)
Date: 2013-12-10T03:39:52-08:00	[thread overview]
Message-ID: <2b6dc37f-4aa6-4c18-be59-8c09f6f37f01@googlegroups.com> (raw)
In-Reply-To: <l86cra$e10$1@loke.gir.dk>

On Tuesday, December 10, 2013 6:37:28 AM UTC, Randy Brukardt wrote:
> "Simon Wright" <simon@pushface.org> wrote in message news:lywqjf45za.fsf@pushface.org... ... > and as far as I can tell this was caused by the Windows 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 > of input line terminators it's reading. I'm surprised that that would be a problem, at least for Unix and Windows files. It's pretty simple to design Text_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 the characters output by New_Line). Of course, such a Text_IO would make a real 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 pairs.) But if you don't want to change the terminators (or your compiler has an 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’s suggestion however daft it may seem to you 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 by one until it is compiled and built ok).  

*I am in Ada just for one solitary piece of problem solving i.e. the implementation 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 => InData, Item => W(I));
      --Ada.Integer_Text_IO.Put(Item => W(I), Width => 8);
    END LOOP;

LOOP;
LOOP;

The EOF marker on my computer is the right arrow => (element number 26 in Latin-1)

I don’t 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 …..

Regards 

Austin - adacrypt

 

  parent reply	other threads:[~2013-12-10 11:39 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-07 12:24 Will Ada-95 Programs Written in MS Windows Run in MacOS and Linux Without Some Tweaking Austin Obyrne
2013-12-07 13:16 ` Simon Wright
2013-12-07 14:01   ` Austin Obyrne
2013-12-07 17:18     ` Simon Wright
2013-12-07 18:26       ` Austin Obyrne
2013-12-08 17:17         ` Simon Wright
2013-12-08 18:17           ` Jeffrey Carter
2013-12-08 20:00             ` Simon Wright
2013-12-08 21:20               ` Jeffrey Carter
2013-12-08 18:44           ` Austin Obyrne
2013-12-08 20:10             ` Simon Wright
2013-12-08 20:31               ` Austin Obyrne
2013-12-08 22:39               ` Austin Obyrne
2013-12-16 11:46                 ` Simon Wright
2013-12-16 19:00                   ` Austin Obyrne
2013-12-16 21:19                     ` Simon Wright
2013-12-16 21:40                       ` Austin Obyrne
2013-12-18  4:44                       ` Austin Obyrne
2013-12-18  8:35                         ` Simon Wright
2013-12-18  9:54                           ` Austin Obyrne
2013-12-18  4:57                       ` Austin Obyrne
2013-12-18  8:55                         ` Simon Wright
2013-12-18  5:38                       ` Austin Obyrne
2013-12-18  9:02                         ` Simon Wright
2013-12-18 13:02                           ` Austin Obyrne
2013-12-16 19:24                   ` Austin Obyrne
2013-12-17  9:06                   ` Austin Obyrne
2013-12-08 20:01           ` Simon Wright
2013-12-10  6:37           ` Randy Brukardt
2013-12-10 10:14             ` Austin Obyrne
2013-12-10 11:39             ` Austin Obyrne [this message]
2013-12-10 21:49               ` Randy Brukardt
2013-12-10 23:08                 ` Binary versus text and compiler versions, was: " Simon Clubley
2013-12-11  8:35                   ` Dmitry A. Kazakov
2013-12-11 12:50                     ` Simon Clubley
2013-12-11 13:29                       ` Dmitry A. Kazakov
2013-12-11 14:20                         ` Simon Wright
2013-12-11 18:25                           ` Simon Clubley
2013-12-11 14:53                     ` G.B.
2013-12-11 15:14                       ` Eryndlia Mavourneen
2013-12-11 16:07                         ` Austin Obyrne
2013-12-11 16:26                           ` Eryndlia Mavourneen
2013-12-11 17:37                             ` Austin Obyrne
2013-12-11 17:54                               ` Eryndlia Mavourneen
2013-12-12  1:55                                 ` Austin Obyrne
2013-12-11 16:54                         ` G.B.
2013-12-11 11:37                   ` Austin Obyrne
2013-12-12 19:23                     ` erlo
2013-12-11 10:35                 ` Austin Obyrne
2013-12-11  0:34             ` Simon Wright
2013-12-11  1:01               ` Jeffrey Carter
2013-12-11  8:38                 ` Simon Wright
2013-12-11 17:07                   ` Simon Wright
2013-12-11  8:49               ` Simon Wright
2013-12-07 22:49       ` Austin Obyrne
2013-12-07 14:08   ` Austin Obyrne
2013-12-08 20:06 ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox