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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,27544cb48c942326 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.205.116.5 with SMTP id fg5mr1018550bkc.3.1319565475016; Tue, 25 Oct 2011 10:57:55 -0700 (PDT) X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 78.192.0.157 Path: l23ni40930bkv.0!nntp.google.com!news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!nntpfeed.proxad.net!78.192.0.157.MISMATCH!news.le-studio75.com!news.tornevall.net!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Length of unbounded_string. Date: Tue, 25 Oct 2011 10:57:53 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: <4ea68441$0$8041$703f8584@textnews.kpn.nl> NNTP-Posting-Host: 8b0f885efd218b99287e7ca1f4a10b40 Mime-Version: 1.0 X-Trace: 112c96ac5e965c14ca947b473569b077 X-Complaints-To: abuse@tornevall.net User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: <4ea68441$0$8041$703f8584@textnews.kpn.nl> X-UserIDNumber: 1738 X-Validate-Post: http://news.tornevall.net/validate.php?trace=112c96ac5e965c14ca947b473569b077 X-Complaints-Italiano: Non abbiamo padronanza della lingua italiana - se mandate una email scrivete solo in Inglese, grazie X-Posting-User: 0243687135df8c4b260dd4a9a93c79bd Xref: news1.google.com comp.lang.ada:18699 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2011-10-25T10:57:53-07:00 List-Id: On 10/25/2011 02:37 AM, ldries46 wrote: > I just found the following extra relevant points: > Instead of I put in the line & Next_Line;> > This showed that with Str := "str," en Next_Line := "Next" the output became > "str x Next" > When I changed Str to Str := "strx" the output changed to "strxx Next" > This looks like the comma has a special meaning within an Unbounded String No Character has a special meaning in a String or an Unbounded_String. This appears to be a problem with the way you're viewing the contents. with Ada.Strings.Unbounded; with Ada.Text_IO; procedure US_Test is use Ada.Strings.Unbounded; Str_Start : constant Unbounded_String := To_Unbounded_String ("str,"); Next_Line : constant Unbounded_String := To_Unbounded_String ("Next"); Str : Unbounded_String := Str_Start; begin -- US_Test Str := Str & " " & Next_Line; Ada.Text_IO.Put_Line (Item => '>' & To_String (Str) & '<'); Str := Str_Start; Str := Str & "x " & Next_Line; Ada.Text_IO.Put_Line (Item => '>' & To_String (Str) & '<'); Str := To_Unbounded_String ("strx"); Str := Str & "x " & Next_Line; Ada.Text_IO.Put_Line (Item => '>' & To_String (Str) & '<'); end US_Test; jrcarter@jrcarter-gateway-1:~/Code$ gnatmake -gnaton -O2 -j2 us_test.adb gcc-4.4 -c -gnaton -O2 us_test.adb gnatbind -x us_test.ali gnatlink us_test.ali jrcarter@jrcarter-gateway-1:~/Code$ ./us_test >str, Next< >str,x Next< >strxx Next< This is GNAT 4.4.5 on Ubuntu 11.04. If this program gives different results on your system, let us know. -- Jeff Carter "Blessed are they who convert their neighbors' oxen, for they shall inhibit their girth." Monty Python's Life of Brian 83