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,3a2f76c3562b7f58 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!feeder.erje.net!feeder.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: type String_Type array(Integer range <>) of Character; Date: Fri, 16 Apr 2010 22:29:19 +0200 Organization: Adalog Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 16 Apr 2010 20:29:21 +0000 (UTC) Injection-Info: feeder.eternal-september.org; posting-host="GkHyU1NAVSDn9og2i84wqg"; logging-data="30454"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19imfhnCkFfOxpSaEI9r8Sf" User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) In-Reply-To: Cancel-Lock: sha1:4lKdNBpHSkLlwg8zqoWQX06kSgc= Xref: g2news2.google.com comp.lang.ada:10997 Date: 2010-04-16T22:29:19+02:00 List-Id: stefan-lucks@see-the.signature a �crit : > Convert S into a variable of type String_Type with String-compatible > bounds, and then convert that variable into a String: > > S : String_Type := "Abc."; > T : String_Type(1 .. S'Length) := S; > U : String(1 .. S'Length); > begin > U := String(T); Put_Line(U); -- or just Put_Line(String(T)); > No need for intermediate copy, just use an appropriate subtype: S : String_Type := "Abc."; T : String(1..4); subtype Slide is String_type (T'Range); begin T := String(Slide(S)); -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr