comp.lang.ada
 help / color / mirror / Atom feed
From: Charmed Snark <snark@cogeco.ca>
Subject: Re: type String_Type array(Integer range <>) of Character;
Date: Fri, 16 Apr 2010 20:53:09 +0000 (UTC)
Date: 2010-04-16T20:53:09+00:00	[thread overview]
Message-ID: <Xns9D5CABC5F34BCSnarkCharmedImSure@188.40.43.245> (raw)
In-Reply-To: hqahb1$tnm$1@news.eternal-september.org

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 698 bytes --]

J-P. Rosen expounded in news:hqahb1$tnm$1@news.eternal-september.org:

> 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));

Great- thanks. Fast service too :)

Warren



  reply	other threads:[~2010-04-16 20:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-16 19:52 type String_Type array(Integer range <>) of Character; Warren
2010-04-16 21:09 ` stefan-lucks
2010-04-16 20:29   ` J-P. Rosen
2010-04-16 20:53     ` Charmed Snark [this message]
2010-04-16 20:56     ` Adam Beneschan
2010-04-19 15:27       ` Warren
replies disabled

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