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,2f343e3986ead102 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!feeder.news-service.com!news.motzarella.org!motzarella.org!not-for-mail From: =?ISO-8859-1?Q?S=E9bastien?= Newsgroups: comp.lang.ada Subject: Re: String declaration and initialization Date: Fri, 23 May 2008 09:33:44 +0000 Organization: A noiseless patient Spider Message-ID: <48368F78.1010604@gmail.com> References: <1sx14jlsjttyu$.me8s3y39ipru.dlg@40tude.net> <4835A3B0.4010101@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: feeder.motzarella.org U2FsdGVkX180/P/Z6kmRhE1NkBus1YZKpsYvJgtm+/uPKv6kqyvRuuxOGlvocXOUccN7qyFfPxMkPsEH1gOTlv7DM6VvEU7MzvBbwhVS/zPPRTogwv5fK1dO2mKlvNFMEBAs8D4rT67JOh/HnCTwJg== X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers NNTP-Posting-Date: Fri, 23 May 2008 09:33:47 +0000 (UTC) In-Reply-To: X-Auth-Sender: U2FsdGVkX19iUfUDUSibo1iZ1+HxZtuaqRMscDsTjYM4bC0QWzudag== Cancel-Lock: sha1:+jVAA8OGji0/iNyO4PLle/C3Pgk= User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) Xref: g2news1.google.com comp.lang.ada:300 Date: 2008-05-23T09:33:44+00:00 List-Id: > No. Make a record of the test name and the test type: > > declare > type Test_Type is range 1..20; > type Test_Case (Length : Positive) is record > Kind : Test_Type; > Name : String (1..Length); > end record; > function Test return Test_Case is -- Ada has scoped subprograms > begin > case Some_Test is > when Test_1 => return (Length => 5, Name => "Test1", Kind => 3); > ... > end case; > end Test; > Buffer: constant Test_Case := Test; > begin > My_Treatment_1 (Buffer.Name); > > [ Observe, that the function Test is nothing but a classical factory. ] Ok got it, I like this one, nice and efficient. Thanks for your help. Sebastien