Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > About String
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 38 Topic 5743 of 5930
Post > Topic >>

About String

by =?ISO-8859-1?Q?S=E9bastien_Morand?= <seb.morand@[EMAIL PROTECTED] > Jun 6, 2008 at 05:29 PM

-----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-----
 




 38 Posts in Topic:
About String
=?ISO-8859-1?Q?S=E9bastie  2008-06-06 17:29:43 
Re: About String
Simon Wright <simon.j.  2008-06-07 17:18:12 
Re: About String
Pascal Obry <pascal@[E  2008-06-07 19:01:07 
Re: About String
Chris Moore <zmower@[E  2008-06-07 23:13:16 
Re: About String
Niklas Holsti <niklas.  2008-06-08 09:47:30 
Re: About String
"Dmitry A. Kazakov&q  2008-06-08 09:35:31 
Re: About String
Sebastien Morand <seb.  2008-06-08 10:29:53 
Re: About String
"Dmitry A. Kazakov&q  2008-06-08 12:53:16 
Re: About String
Niklas Holsti <niklas.  2008-06-08 14:14:04 
Re: About String
"Dmitry A. Kazakov&q  2008-06-08 15:16:54 
Re: About String
Niklas Holsti <niklas.  2008-06-08 20:17:33 
Re: About String
"Dmitry A. Kazakov&q  2008-06-09 09:26:26 
Re: About String
Chris Moore <zmower@[E  2008-06-08 19:26:21 
Re: About String
Robert A Duff <bobduff  2008-06-08 14:32:36 
Re: About String
Simon Wright <simon.j.  2008-06-08 12:13:50 
Re: About String
Sebastien Morand <seb.  2008-06-08 19:03:17 
Re: About String
Martin <martin.dowie@[  2008-06-08 04:48:56 
Conditional declarations (was: About String)
"Dmitry A. Kazakov&q  2008-06-08 15:17:03 
Re: About String
Maciej Sobczak <see.my  2008-06-08 13:51:07 
Re: About String
Robert A Duff <bobduff  2008-06-08 17:19:11 
Re: About String
"Dmitry A. Kazakov&q  2008-06-09 09:14:30 
Re: About String
Georg Bauhaus <rm.dash  2008-06-09 11:43:36 
Re: About String
"Dmitry A. Kazakov&q  2008-06-09 12:25:02 
Re: About String
=?ISO-8859-1?Q?S=E9bastie  2008-06-09 10:42:18 
Re: About String
Georg Bauhaus <rm.dash  2008-06-09 13:43:21 
Re: About String
"Dmitry A. Kazakov&q  2008-06-09 14:03:37 
Re: About String
Robert A Duff <bobduff  2008-06-15 15:38:08 
Re: About String
"Dmitry A. Kazakov&q  2008-06-15 22:52:45 
Re: About String
Robert A Duff <bobduff  2008-06-15 18:06:00 
Re: About String
"Dmitry A. Kazakov&q  2008-06-16 10:31:03 
Re: About String
Robert A Duff <bobduff  2008-06-16 15:17:15 
Re: About String
"Dmitry A. Kazakov&q  2008-06-16 22:30:12 
Re: About String
Georg Bauhaus <rm.tsoh  2008-06-17 00:02:51 
Re: About String
Robert A Duff <bobduff  2008-06-16 19:04:54 
Re: About String
Georg Bauhaus <rm.dash  2008-06-09 13:00:44 
Re: About String
Robert A Duff <bobduff  2008-06-15 15:48:49 
Re: About String
Britt Snodgrass <britt  2008-06-09 07:27:05 
Re: About String
Robert A Duff <bobduff  2008-06-15 15:50:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 22:32:16 CDT 2008.