comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Problem with Unbounded Strings
Date: Fri, 4 Dec 2015 11:08:06 -0700
Date: 2015-12-04T11:08:06-07:00	[thread overview]
Message-ID: <n3sklk$fpv$1@dont-email.me> (raw)
In-Reply-To: <e28c35a7-5f41-4beb-afb3-eb4fc9da9384@googlegroups.com>

I would ignore Kazakov's comments. While he prefers to avoid unbounded strings,
many others don't, so if the characteristics of Unbounded_String are suitable
for your project there is no reason not to use them.

You can't use a case statement because you're comparing strings, and case
statements can only be used for discrete types.

On 12/04/2015 08:49 AM, Laurent wrote:
> procedure Read_Message (File         : in Ada.Text_IO.File_Type;
>  ...
>       while not Ada.Text_IO.End_Of_File (Log_File) loop

What is Log_File?

>                  U_B.Append (Source   => Buffer,
>                             New_Item => Line (5 .. Line'Last));

I see nothing wrong with this use of append. If it's possible that 5 > Line'Last
then you would be appending a null string, which would not change the value of
Buffer. It would be nice if you could reduce your example to eliminate the
irrelevant parts and provide some input and corresponding output (and expected
output) that demonstrates your problem. Otherwise I'm unable to to offer any
advice. Certainly I've made extensive use of Unbounded_String and never
encountered any problem with Append, so you probably have a logic problem.

-- 
Jeff Carter
"Well, a gala day is enough for me. I don't think
I can handle any more."
Duck Soup
93


  parent reply	other threads:[~2015-12-04 18:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 15:49 Problem with Unbounded Strings Laurent
2015-12-04 16:04 ` Dmitry A. Kazakov
2015-12-04 16:53   ` Laurent
2015-12-04 18:00     ` Niklas Holsti
2015-12-04 21:05       ` Laurent
2015-12-04 20:34     ` Dmitry A. Kazakov
2015-12-04 21:43       ` Laurent
2015-12-04 22:23         ` Dmitry A. Kazakov
2015-12-05 10:22           ` Laurent
2015-12-05 12:19             ` Dmitry A. Kazakov
2015-12-05 13:15               ` Laurent
2015-12-04 18:08 ` Jeffrey R. Carter [this message]
2015-12-04 21:21   ` Laurent
2015-12-04 21:59     ` Simon Wright
2015-12-04 23:19       ` Laurent
2015-12-04 22:02     ` Dmitry A. Kazakov
2015-12-04 22:28     ` Jeffrey R. Carter
2015-12-04 23:35       ` Laurent
2015-12-04 23:59         ` Jeffrey R. Carter
2015-12-05 10:13           ` Laurent
2015-12-08  1:53           ` Randy Brukardt
2015-12-04 23:00     ` Ben Bacarisse
replies disabled

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