Re: Array slices and types
- From: "Steve" <nospam_steved94@xxxxxxxxxxx>
- Date: Fri, 22 Aug 2008 19:50:17 -0700
"Maciej Sobczak" <see.my.homepage@xxxxxxxxx> wrote in message
news:5886ab95-8744-4b72-b911-e4cb8889c7e7@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Consider this:
type Name is new String (1 .. 10);
N : Name;
Some_String : String := "abc";
How can I assign Some_String to the beginning slice (ie. to the first
three characters) of N?
Everything that I can think of (short of copying characters
individually) hits the type compatibility problem.
If you can change the definition of Name to:
subtype Name is String( 1 .. 10 );
Then of course you can use:
N( 1 .. 3 ) := Some_String( 1 .. 3 );
But that doesn't sound like what you're looking for.
Regards,
Steve
--
Maciej Sobczak * www.msobczak.com * www.inspirel.com
Database Access Library for Ada: www.inspirel.com/soci-ada
.
- References:
- Array slices and types
- From: Maciej Sobczak
- Array slices and types
- Prev by Date: Re: Access to function returning class-wide type
- Next by Date: Re: C chars_ptr STORAGE_ERROR in Imported function
- Previous by thread: Re: Array slices and types
- Next by thread: Status of ayacc and aflex?
- Index(es):
Relevant Pages
|