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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,146ef816afa699d1 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.46.193 with SMTP id x1mr28035361pbm.7.1319469077958; Mon, 24 Oct 2011 08:11:17 -0700 (PDT) Path: c1ni7918pbr.0!nntp.google.com!news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!feeder.news-service.com!tudelft.nl!txtfeed1.tudelft.nl!feed.xsnews.nl!border-1.ams.xsnews.nl!upload-2.xsnews.nl!10.10.69.1.MISMATCH!frontend-F09-01.ams.textnews.kpn.nl From: "ldries46" Newsgroups: comp.lang.ada References: <4e9a9a6d$0$3238$703f8584@news.kpn.nl> <9fvo6aF3d6U1@mid.individual.net> <4e9ad365$0$3267$703f8584@news.kpn.nl> <9g02plFrnlU1@mid.individual.net> <4e9bdbc7$0$3240$703f8584@news.kpn.nl> <9g3f3kFfr7U1@mid.individual.net> <4e9d6722$0$3244$703f8584@news.kpn.nl> <9g5snkFlh0U1@mid.individual.net> <4e9e37ea$0$3272$703f8584@news.kpn.nl> <9g77mgFribU1@mid.individual.net> In-Reply-To: <9g77mgFribU1@mid.individual.net> Subject: Re: Length of unbounded_string. Date: Mon, 24 Oct 2011 17:10:57 +0200 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 15.4.3538.513 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3538.513 Message-ID: <4ea580d4$0$8044$703f8584@textnews.kpn.nl> Organization: KPN.com NNTP-Posting-Host: 77.168.179.107 X-Trace: 1319469268 textnews.kpn.nl 8044 77.168.179.107@kpn/77.168.179.107:53123 Xref: news1.google.com comp.lang.ada:18683 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit Date: 2011-10-24T17:10:57+02:00 List-Id: 1. Indeed for some reason then the 1); is of the E-mail but the compiler would not have compiled the program without. ch now has the value of the first character of Next_Line. 2. Next Line is a Global variable to be used in a lot of routines before and after this one. 3. You are right but I am sure the Next_Line has other characters in the line. If not the program would have never come in this routine. 4. I see that the message was not correctly received both statements also had correct syntax. str := str & " " & Next_Line; Original_Line := str; 5. The string should not have BackSpaces but I think that if so comma should be found with a next position statement searching for it, and it did not. "Niklas Holsti" schreef in bericht news:9g77mgFribU1@mid.individual.net... On 11-10-19 04:38 , ldries46 wrote: > The complete code of which I would conclude that the comma should be > present is: [ snip ] > nr := nr + 1; > ch := Element(Next_Line, -- Next_LIne is a unbounded_string > that can be connected to str The assignment to ch is incomplete, there should be something after the comma. Looking at the loop below, I guess the statement is meant to be ch := Element(Next_Line, 1); Also, at this point in the code, Next_Line has not been given any value, it has not even been declared. Is it a global variable? What does it contain when your problem occurs? > while ch = ' ' or ch = ASCII.HT loop > Replace_Slice(Next_Line, 1, 1, ""); > ch := Element(Next_Line, 1); > end loop; That loop will end badly if Next_Line contains only whitespace. You should exit the loop when the Replace_Slice makes Next_Line a null string. > str := str & " " & -- After this statement the error is found by the > display function of the GDB > Original_Line := -- Original Line is only meant for the error messges Both those statements are syntactically incomplete. The first one ends with an operator "&"; there should be at least one more operand, and a terminating semicolon. The second one ends with ":=". > Next_Line := To_Unbounded_String(""); You should exit the outer loop ("while not ok") at this point, I think, because otherwise you can loop back to the statement ch := Element(Next_Line, 1); with Next_Line holding a null string, which is an indexing error. I notice that you check for tab characters (HT). Can it happen that the string contains backspace characters? If the string has a comma, then a backspace, the comma is perhaps not visible on the screen when the string is displayed. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .