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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5fc9b87ca6f5fbaf X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-12 18:49:20 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn12feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc01.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: array slices References: <3EC0494F.A7D67AA4@bellsouth.net> X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc01 1052790559 12.234.13.56 (Tue, 13 May 2003 01:49:19 GMT) NNTP-Posting-Date: Tue, 13 May 2003 01:49:19 GMT Organization: AT&T Broadband Date: Tue, 13 May 2003 01:49:19 GMT Xref: archiver1.google.com comp.lang.ada:37258 Date: 2003-05-13T01:49:19+00:00 List-Id: > a : array(1..4) of integer; > c : array( 1..2, 1..4 ) of integer; > a(1..4) := c(1)(1..4); There are two problems here. 1) you can only take slices of one dimensional arrays (yes, that is annoying). 2) A and C are of different (anonymous) types so the compiler will point that out if you try to assign a chunk of one to the other. If you do type Rows is array(1 .. 4) of integer; a : Rows; c : array(1 .. 2) of Rows; then any of a(1 .. 4) := c(1)(1 .. 4); a := c(1); a(3 .. 4) := c(2)(1 .. 2); are ok. or type Rows is array(integer range <>) of integer; a : Rows(1 .. 4); c : array(1 .. 2) of Rows(1 .. 4); d : array(5 .. 6) of Rows(11 .. 25); a(1 .. 2) := d(6)(11 .. 12); will also work.