comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Basic Array Subscripting Question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Basic Array Subscripting Question [message #80441 is a reply to message #80304] Fri, 01 June 2012 07:58 Go to previous message
Lajos Foldy is currently offline  Lajos Foldy
Messages: 176
Registered: December 2011
Senior Member
On Thursday, May 31, 2012 11:38:59 AM UTC+2, Rob wrote:
> This is very basic stuff but for some reason it's leaving me stumped.
>
> I always thought that:
>
> array[412:413, 18:19] was equivalent to array[[412,413], [18,19]]
>
> but the first returns a 2,2 array (which I want) whilst the second
> only returns a 2 element array.
>
> <Expression> DOUBLE = Array[2, 2]
> <Expression> DOUBLE = Array[2]
>
> Any idea what I'm doing wrong?

This is documented in 'Combining Array Subscripts':

When combining two subscript arrays, each element of the first subscript array is combined with the corresponding element of the second subscript array. The two subscript arrays must have the same number of elements. The resulting subscript array has the same number of elements as its constituents. For example, the expression A[[1, 3], [5, 9]] yields the elements A[1,5] and A[3,9].

regards,
Lajos
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Basic Array Subscripting Question
Next Topic: V8.2 compilation error, works in V8.1

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 04:23:32 PDT 2025

Total time taken to generate the page: 1.27888 seconds