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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,86c750b8474bf6d5,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!feeder.news-service.com!news.motzarella.org!motzarella.org!not-for-mail From: =?ISO-8859-1?Q?S=E9bastien_Morand?= Newsgroups: comp.lang.ada Subject: About String Date: Fri, 06 Jun 2008 17:29:43 +0000 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: feeder.motzarella.org U2FsdGVkX18+gC1HDTR6gqowWgfbdy9j34EulnHMHPklUzQ61xL/CLUwiMGw/5/v0eggeEsDWlIY79RfKkyMbxbcJWQqwrS0z0sgj0Zwwntsu3JxAoJh8/YkZGNI/03qdQQ04sTZ2OrXtYaRSKHRwg== X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers NNTP-Posting-Date: Fri, 6 Jun 2008 17:29:48 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1/IkJKhnGDj3SKooD+X3/KP3r5lNPgCuHAucdi7ZP+mqQ== Cancel-Lock: sha1:c/l2sxhDFcdFAPDtSc2dnJbvpxc= User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) X-Enigmail-Version: 0.95.6 Xref: g2news1.google.com comp.lang.ada:592 Date: 2008-06-06T17:29:43+00:00 List-Id: -----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-----