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=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 19:40:49 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!border1.nntp.ash.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 10 Dec 2003 21:40:47 -0600 Date: Wed, 10 Dec 2003 22:40:46 -0500 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Latin_1 and portability References: <344d0fee.0312100415.63724db9@posting.google.com> In-Reply-To: <344d0fee.0312100415.63724db9@posting.google.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.34.214.193 X-Trace: sv3-HkCDwat0jwTUPNXka/TOXoU+cvniEn/8ktF8qYCRJB/hBoBAbTM2qgijrukWpUZCk6fbFEu43CMRGrv!jGAXG4Wa27NDC9poAbu4BmeNriD5TFM4EKvf5bMgG4w0qRblISB4vngGv7bC+g== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:3348 Date: 2003-12-10T22:40:46-05:00 List-Id: Xavier Serrand wrote: > Hello, > > 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 > > How can I manage to work properly ... > Do i have to parametrize my application reading characters from a file > ... and looking at the values recognized by the functions ... Is there > anothers means ? > > Thanks for Ada's Gurus who can help me a very little bit ..... This turns out not to be an Ada issue, but you still have to deal with it. The Ada Reference Manual doesn't specify what indicates the end of a line. This is because the choice of how lines are delimited is a property of the file type. On Windows, .txt files use CR (13) as a line delimiter and on Unix LF (10) is used. There are also formats that use CR followed by LF, or VT(11), and many formats use FF(12) as an end of line AND page mark. If you are reading from a file, then you can let Text_IO handle the issue, even if the file format is one where the end of a line is represented implicitly with a character count. (Not too common anymore.) But you are trying to read from a user input device. What do you get? Whatever the user gives you, as mapped by the OS. ;-) I would tend to test for all four: E in Latin1.LF..Latin.CR. That should deal with most existing operating systems. The operating system maps the keys on the keyboard to ASCII or other characters. In most operating systems, you can choose some other keyboard mapping that the standard. I actually have about six set up, but the two I use most are United States and International. This allows me to type characters like o-diaresis, or e-acute. It also lets me type Japanese, Chinese, and Korean, but you do not want to deal with that. -- Robert I. Eachus 100% Ada, no bugs--the only way to create software.