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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d54559bde05f5bb8 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!wn14feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: Weird string I/O problem Reply-To: no to spamers (No@email.given.org) References: <6d9d4120-3af9-42c6-b3e9-768418948084@t3g2000yqa.googlegroups.com> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Tue, 02 Dec 2008 06:55:25 GMT NNTP-Posting-Host: 12.65.198.211 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1228200925 12.65.198.211 (Tue, 02 Dec 2008 06:55:25 GMT) NNTP-Posting-Date: Tue, 02 Dec 2008 06:55:25 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:3822 Date: 2008-12-02T06:55:25+00:00 List-Id: Have you ever learn, you do not give the complete code, because too many students like to steal code for there grade. So, you ONLY give enough code for the person to use the code to build his own. And that's what i did! And what of your answer! In <6d9d4120-3af9-42c6-b3e9-768418948084@t3g2000yqa.googlegroups.com>, christoph.grein@eurocopter.com writes: >On 1 Dez., 20:47, a...@anon.org (anon) wrote: >> -- >> -- Build your own input routine. =A0Example: >> -- >> with Ada.Characters.Latin_1 ; -- Needed for control chars. >> use Ada.Characters.Latin_1 ; >> >> -- ... >> =A0 char : character ; >> =A0 input_string : String ( 1..80 ) ; >> =A0 last : natural ; >> >> -- ... >> >> input_string :=3D ( others =3D> nul ) ; >> for index in input_string'Range loop >> =A0 Get ( char ) ; >> =A0 exit when char =3D CR or char =3D LF ; > >Does anon ever read the RM? See A.10.7(1..3): >After skipping any line terminators and any page terminators, reads >the next character from the >specified input file and returns the value of this character in the >out parameter Item. > >Also A.9(8): Effect of input (Get) ... of control characters ... is >not specified. > >This tries to do what Get_Line is for - and is wrong! > >> =A0 input_string ( index ) :=3D char ; >> =A0 Last :=3D Index ; =A0 >> end loop >> >> =A0 -- valid data is input_string ( 1 .. last ) ; with no term control ch= >aracters >> >> -- ...