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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2f343e3986ead102 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!news.germany.com!news.ecp.fr!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: String declaration and initialization Date: Thu, 22 May 2008 18:40:29 +0200 Organization: Adalog Message-ID: <6m741g.vm2.ln@hunter.axlog.fr> References: NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1211472555 21363 195.25.228.57 (22 May 2008 16:09:15 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Thu, 22 May 2008 16:09:15 +0000 (UTC) User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) In-Reply-To: Xref: g2news1.google.com comp.lang.ada:292 Date: 2008-05-22T18:40:29+02:00 List-Id: S�bastien a �crit : > Hi, > > Several times I had to do the following: [...] > > But How can I do this since I can't declare a string without constraint? > declare function choose_the_right_one return string is begin case SomeTest is case TEST1 => return "Test1"; case TEST2 => return "Test2"; end case; end choose_the_right_one; buffer: String := Choose_The_Right_One; begin MyTreatment1(buffer, buffer'Size); MyTreatment2(buffer, buffer'Size); MyTreatment3(buffer, buffer'Size); end; -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr