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.83.84 with SMTP id g20mr3304887icl.23.1429936284795; Fri, 24 Apr 2015 21:31:24 -0700 (PDT) X-Received: by 10.140.93.14 with SMTP id c14mr17873qge.42.1429936283662; Fri, 24 Apr 2015 21:31:23 -0700 (PDT) Path: border2.nntp.dca1.giganews.com!nntp.giganews.com!l13no9759445iga.0!news-out.google.com!k20ni1063qgd.0!nntp.google.com!j5no3600157qga.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 24 Apr 2015 21:31:23 -0700 (PDT) In-Reply-To: <47c7df1e-17c1-44cb-a455-43431f0d39cd@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=178.194.9.6; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG NNTP-Posting-Host: 178.194.9.6 References: <47c7df1e-17c1-44cb-a455-43431f0d39cd@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <67c2d992-bea4-4043-b7c3-38a2630d965b@googlegroups.com> Subject: Re: Annoying behavior From: gautier_niouzes@hotmail.com Injection-Date: Sat, 25 Apr 2015 04:31:23 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: number.nntp.giganews.com comp.lang.ada:192916 Date: 2015-04-24T21:31:23-07:00 List-Id: [...] > So the first antibiotic is read but then something blows up. Has to to with the SIR which is an enumeration. The others are strings. If I remove the SIR's from the config file then all items are read. So instead of using SIR_Type_IO it is perhaps better to read the SIR like another item, them do Temp_Record.SIR := SIR'Value(item_str). Especially, it's not sure that Enumeration_IO understands the '|'-separated parsing rule. [...] > Another strange behavior (for me, perhaps it is absolutely normal) is this one: > > laurent-lutgens-mac-pro-2:Build laurent$ ./generateur_trame_vt2 > Begin of reading loop > read name: Amikacine > read code: amk > read cmi: testtest > > Begin of reading loop > read name: Augkacine <-- should be "Aug" > read code: pmk <-- should be "p" > read cmi: 123ttest <-- should be "123" What is happenning is exactly what you have programmed: Name (1 .. S'Length) := S; At some point Name is "Amikacine " Then you have S = "Aug", so the 3 first letters are replaced and you get "Augkacine ". If you stuff with spaces it will solve the problem. Either with Name:= (others => ' '); before copying S or Name(S'Length+1..Name'Last):= (others => ' '); before or after. HTH _________________________ Gautier's Ada programming http://gautiersblog.blogspot.com/search/label/Ada NB: follow the above link for a valid e-mail address