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.66.222.41 with SMTP id qj9mr7566240pac.30.1429998372746; Sat, 25 Apr 2015 14:46:12 -0700 (PDT) X-Received: by 10.140.91.47 with SMTP id y44mr50160qgd.39.1429998372697; Sat, 25 Apr 2015 14:46:12 -0700 (PDT) Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!l13no10082307iga.0!news-out.google.com!k20ni1077qgd.0!nntp.google.com!z60no3729295qgd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 25 Apr 2015 14:46:12 -0700 (PDT) In-Reply-To: <0ddcdd13-c29c-46e2-b516-3cc26a964d6e@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=87.240.246.10; posting-account=sDyr7QoAAAA7hiaifqt-gaKY2K7OZ8RQ NNTP-Posting-Host: 87.240.246.10 References: <47c7df1e-17c1-44cb-a455-43431f0d39cd@googlegroups.com> <85zj5wb9et.fsf@stephe-leake.org> <4b14659e-8c26-4c0a-8945-a5289740e054@googlegroups.com> <2eb67902-3df4-4e18-ac36-7580de229a2c@googlegroups.com> <0ddcdd13-c29c-46e2-b516-3cc26a964d6e@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <27f38829-7c35-4667-bacd-5c6122fea012@googlegroups.com> Subject: Re: Annoying behavior From: Laurent Injection-Date: Sat, 25 Apr 2015 21:46:12 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: number.nntp.giganews.com comp.lang.ada:192939 Date: 2015-04-25T14:46:12-07:00 List-Id: I figured out how to us bounded strings. Quite a PITA! Twisted constructions like this: Ada.Text_IO.Put_Line ("read code: " & Codes.To_String (Temp_Record.Code_SIL)); my favorite: Ada.Text_IO.Put_Line (File => Config_File, Item => Names.To_String(Get_Name (Name_Code_Array.Anti_Config (Counter)))); At least it works. If I need/want to initialize a bounded string to some default value then I have to do this: Temp_Record := (Name => Names.To_Bounded_String("Test"), Code_SIL => Codes.To_Bounded_String(" "), CMI => CMIs.To_Bounded_String("<0.01"), SIR => S); Is that really necessary or are bounded strings null, empty or whatever by default? Because one of my problems was caused by the fact that I didn't reset my Temp_record in the loop. While first experimenting I uncommented the reset part and it worked. That's why I ask. In John Barnes Ada I found the minimum length is 1. So the first reading is ok. But on the following ones: if actual string < previous string which is still stored in Temp_Record.Name then previous str. is replaced by actual str. because it is kind of a new string. while before with the standard string only the slice which had changed, got replaced Is that right or complete garbage? Thanks Laurent