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,db8ef2e54cb04ab9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!x21g2000yqa.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Unbounded String to string Date: Tue, 29 Jun 2010 07:33:13 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9eec8378-892b-4299-bde7-4f92535f0c20@x21g2000yqa.googlegroups.com> References: <004d7e0b-cf0a-4a71-ac7e-17b61818b910@5g2000yqz.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1277821993 4182 127.0.0.1 (29 Jun 2010 14:33:13 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 29 Jun 2010 14:33:13 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x21g2000yqa.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:12956 Date: 2010-06-29T07:33:13-07:00 List-Id: On Jun 29, 7:28=A0am, tonyg wrote: > Hi, > =A0 =A0I have an unbounded string from a database I want to turn into a 1= 6 > character subtype of string > > i.e. unbounded_string to string(1..16) > > I've been trying to do this most of the afternoon but keep getting > errors > > anyone know how ? Declare a subtype to give string(1..16) a name; then call To_String (in Ada.Strings.Unbounded) and convert the function result to your subtype. E.g.: subtype String_Length_16 is string(1..16); V : String_Length_16; V :=3D String_Length_16 (Ada.Strings.Unbounded.To_String (U)); -- Adam