comp.lang.ada
 help / color / mirror / Atom feed
From: "Sébastien Morand" <seb.morand@gmail.com>
Subject: About String
Date: Fri, 06 Jun 2008 17:29:43 +0000
Date: 2008-06-06T17:29:43+00:00	[thread overview]
Message-ID: <g2bs6b$h2m$1@registered.motzarella.org> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm curious about how you are using string. I think string are quite
useful, but how they are fixed size, I'm often defining them in the
declare part.

I don't know if it's a good practice, but I got code like this:

      urio: constant AWS.URL.Object := AWS.Status.URI(request);
      host_raw: constant String := AWS.Status.Host(request);
      host: constant String := host_raw(host_raw'First ..
First_Index(host_raw, ':'));
      www: constant String := SCMAL.Httpd.Servers.GetWWW(host);
      Filename: constant String := AWS.URL.Abs_Path(urio);

and so on.

So the main problem is error management. If one function raise
exception, the exception can't be catch except with the following trick:

procedure Patati_Patata is
begin
	declare
		s: String := A_Function_Raising_Constraint_Error;
	begin
		--  some code
		null;
	end;
exception
	when Constraint_Error =>
		Put_Line("I got an error");
end;

Is there nicer way to do that? I'm trying to avoid Unbounded_String
because of the conversion when mixing Unbounded_String and String.

S�bastien
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iD8DBQFISXQH+zV9xm4PlDQRAp1AAJ98x/YTeiFzGP4PGJeL+7B2+iLtRQCggbzh
Xcv5gRRjhmFVnCqVVQRk4QM=
=tG7M
-----END PGP SIGNATURE-----



             reply	other threads:[~2008-06-06 17:29 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06 17:29 Sébastien Morand [this message]
2008-06-07 16:18 ` About String Simon Wright
2008-06-07 17:01   ` Pascal Obry
2008-06-07 22:13     ` Chris Moore
2008-06-08  6:47       ` Niklas Holsti
2008-06-08  7:35         ` Dmitry A. Kazakov
2008-06-08 10:29           ` Sebastien Morand
2008-06-08 10:53             ` Dmitry A. Kazakov
2008-06-08 11:14           ` Niklas Holsti
2008-06-08 13:16             ` Dmitry A. Kazakov
2008-06-08 17:17               ` Niklas Holsti
2008-06-09  7:26                 ` Dmitry A. Kazakov
2008-06-08 11:48           ` Martin
2008-06-08 13:17             ` Conditional declarations (was: About String) Dmitry A. Kazakov
2008-06-08 18:26           ` About String Chris Moore
2008-06-08 18:32         ` Robert A Duff
2008-06-08 20:51           ` Maciej Sobczak
2008-06-08 21:19             ` Robert A Duff
2008-06-09  7:14               ` Dmitry A. Kazakov
2008-06-09  9:43                 ` Georg Bauhaus
2008-06-09 10:25                   ` Dmitry A. Kazakov
2008-06-09 10:42                     ` Sébastien Morand
2008-06-09 11:43                     ` Georg Bauhaus
2008-06-09 12:03                       ` Dmitry A. Kazakov
2008-06-15 19:38                 ` Robert A Duff
2008-06-15 20:52                   ` Dmitry A. Kazakov
2008-06-15 22:06                     ` Robert A Duff
2008-06-16  8:31                       ` Dmitry A. Kazakov
2008-06-16 19:17                         ` Robert A Duff
2008-06-16 20:30                           ` Dmitry A. Kazakov
2008-06-16 22:02                           ` Georg Bauhaus
2008-06-16 23:04                             ` Robert A Duff
2008-06-09 11:00               ` Georg Bauhaus
2008-06-09 14:27                 ` Britt Snodgrass
2008-06-15 19:50                   ` Robert A Duff
2008-06-15 19:48                 ` Robert A Duff
2008-06-08 11:13     ` Simon Wright
2008-06-08 19:03       ` Sebastien Morand
replies disabled

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