comp.lang.ada
 help / color / mirror / Atom feed
From: tonyg <tonythegair@googlemail.com>
Subject: Re: Unbounded String to string
Date: Tue, 29 Jun 2010 07:37:22 -0700 (PDT)
Date: 2010-06-29T07:37:22-07:00	[thread overview]
Message-ID: <dca03224-2112-4b36-bfcc-88890436bd84@y11g2000yqm.googlegroups.com> (raw)
In-Reply-To: 9eec8378-892b-4299-bde7-4f92535f0c20@x21g2000yqa.googlegroups.com

On 29 June, 15:33, Adam Beneschan <a...@irvine.com> wrote:
> On Jun 29, 7:28 am, tonyg <tonytheg...@googlemail.com> wrote:
>
> > Hi,
> >    I have an unbounded string from a database I want to turn into a 16
> > 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 := String_Length_16 (Ada.Strings.Unbounded.To_String (U));
>
>                         -- Adam

Thanks Adam



  reply	other threads:[~2010-06-29 14:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-29 14:28 Unbounded String to string tonyg
2010-06-29 14:33 ` Adam Beneschan
2010-06-29 14:37   ` tonyg [this message]
2010-06-29 15:08     ` Ludovic Brenta
2010-06-29 15:19       ` Adam Beneschan
2010-06-30  8:28         ` tonyg
2010-07-01  7:18 ` Jerry
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox