comp.lang.ada
 help / color / mirror / Atom feed
From: "ldries46" <bertus.dries@planet.nl>
Subject: Re: Length of unbounded_string.
Date: Wed, 19 Oct 2011 04:38:17 +0200
Date: 2011-10-19T04:38:17+02:00	[thread overview]
Message-ID: <4e9e37ea$0$3272$703f8584@news.kpn.nl> (raw)
In-Reply-To: <9g5snkFlh0U1@mid.individual.net>

The complete code of which I would conclude that the comma should be present 
is:
--------------------------------------------------------------------------------
-- The procedure adds Lines together when a "," is the end of the line
-- statements or when the end of the line is not a ";" or "{" or "}"
--------------------------------------------------------------------------------
   procedure Continuation(str : in out Unbounded_String; nr : in out 
integer) is
      len : integer;
      ch  : character;
      ok  : boolean := false;
   begin
      Proc_Stack.Push(To_Unbounded_String("Continuation"));                  
                 -- a Stack procedure that is used for the error messages 
the program can produce
      while not ok loop
         len := Length(str);
         if len /= 0 then
            ch := Element(str, len);
            if ch = ',' or (ch /= ';' and ch /= '{' and ch /= '}') then
               nr := nr + 1;
               ch := Element(Next_Line, 
    -- Next_LIne is a unbounded_string that can be connected to str
               while ch = ' ' or ch = ASCII.HT loop
                  Replace_Slice(Next_Line, 1, 1, "");
                  ch := Element(Next_Line, 1);
               end loop;
               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
               if nr < Buffer1.Length - 1 
     -- Buffer1 is a buffer of unbounded_atring's thatis the source for as 
well str as Next_Line
                  Next_Line := Buffer1.Get_Buffer( nr + 
     -- nr is the line nr in the buffer where str is located
               else
                  Next_Line := To_Unbounded_String("");
            end if;
            else
               ok := true;
            end if;
         else
            ok := true;
         end if;
      end loop;
      Proc_Stack.Remove;                                                     
                                           -- Removes "continuation" from 
the stack
   end Continuation;

The error is somewhere in this routine

"Niklas Holsti"  schreef in bericht news:9g5snkFlh0U1@mid.individual.net...

On 11-10-18 13:47 , ldries46 wrote:
> The program I am writing is a window oriented program. I am using GTKADA
> for the windows. When I write the string to the window it also misses
> the comma.
> Also further on in the program before writing to the window I check for
> the comma but the function I need to do is not performed so that is
> another reason why I think the comma is not present.

So, it is likely that the comma is absent. But I can't think about why
it is absent, and whether this is a compiler/library erroror an error in
your code, until you show the complete code that you think should make
the comma present.

Sorry, but I can do nothing more.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       . 




  reply	other threads:[~2011-10-19  2:38 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-16  8:48 Length of unbounded_string ldries46
2011-10-16  9:59 ` Niklas Holsti
2011-10-16 12:06   ` ldries46
2011-10-16 12:52   ` ldries46
2011-10-16 13:00     ` Niklas Holsti
2011-10-17  7:39       ` ldries46
2011-10-17 19:49         ` Niklas Holsti
2011-10-18 11:47           ` ldries46
2011-10-18 17:54             ` Niklas Holsti
2011-10-19  2:38               ` ldries46 [this message]
2011-10-19  6:07                 ` Niklas Holsti
2011-10-24 15:10                   ` ldries46
2011-10-19  6:37                 ` Simon Wright
2011-10-19 14:48                 ` Alex Mentis
2011-10-24 17:04                   ` ldries46
2011-10-16 10:14 ` Vinzent Hoefler
  -- strict thread matches above, loose matches on Subject: below --
2011-10-25  9:37 ldries46
2011-10-25 17:57 ` Jeffrey Carter
2011-10-28  2:54   ` ldries46
2011-10-28  4:55     ` Jeffrey Carter
2011-10-25 20:23 ` Vadim Godunko
2011-10-25 21:28   ` Simon Wright
2011-10-26  4:41     ` Simon Wright
2011-10-26 22:47     ` Randy Brukardt
2011-10-27  8:05       ` AdaMagica
2011-10-27  8:56       ` Simon Wright
2011-10-27 11:05         ` Brian Drummond
2011-10-28  3:12           ` ldries46
     [not found]           ` <4eafc489$0$3081$703f8584@textnews.kpn.nl>
2011-11-01 18:22             ` Jeffrey Carter
2011-10-27 11:28         ` Georg Bauhaus
2011-10-27 12:17           ` Dmitry A. Kazakov
2011-10-27 13:31             ` Georg Bauhaus
2011-10-27 14:34               ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox