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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,29495b0e9519b616 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-10 13:52:33 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!news-out.visi.com!petbe.visi.com!skynet.be!skynet.be!louie!tjb!not-for-mail Sender: lbrenta@lbrenta Newsgroups: comp.lang.ada Subject: Re: Latin_1 and portability References: <344d0fee.0312100415.63724db9@posting.google.com> From: Ludovic Brenta Date: 10 Dec 2003 22:52:32 +0100 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: -= Belgacom Usenet Service =- NNTP-Posting-Host: 81.241.25.221 X-Trace: 1071093152 reader3.news.skynet.be 5487 81.241.25.221:54029 X-Complaints-To: usenet-abuse@skynet.be Xref: archiver1.google.com comp.lang.ada:3337 Date: 2003-12-10T22:52:32+01:00 List-Id: Pascal Obry writes: > xavier.serrand@free.fr (Xavier Serrand) writes: > > > For return (or enter) > > > > when using Text_Io.Get_Immediate (E); > > > > on UNIX or Linux Suse Character'Pos (E) = 10 > > on Windows 2000 Character'Pos (E) = 13 > > On Windows you should get 13+10 (CRLF) on UNIX only 10 (LF). You > could try to skip the 13 and call Get_Immediate a second time in > this case. Just in case you're new to computers: CR stands for Carriage Return and LF stands for Line Feed. These are instructions for the cursor of the terminal or the printing head of a teletype or printer, and are encoded in ASCII as 13 and 10 respectively (in decimal; in hex they are 0D and 0A respectively). CR causes the cursor to go the the left of the page, LF causes it to go down one line. By convention, text files (and the terminal) on Windows use a sequence of CR and LF to signal the end of a line. Unices and GNU/Linux use a different convention with only LF. That is why Pascal's advice of just ignoring the CR should get you going. However, others have pointed at function Text_IO.End_Of_Line, which does this for you in a more portable way not relying on particular ASCII codes. -- Ludovic Brenta.