|
Re: select first n elements of array without loop [message #72017 is a reply to message #72016] |
Wed, 04 August 2010 13:11  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Aug 4, 5:06 pm, David Fanning <n...@dfanning.com> wrote:
> Fermiona Fermiona writes:
>> If I have an array and I want to select say, the first n elements
>> thereof, can I do so without using a loop.
>
>> For example if I want to select all the elements, I'd use an *
>
> subarrar = array[0:n]
Though that selects the first n+1 elements.
|
|
|
Re: select first n elements of array without loop [message #72018 is a reply to message #72017] |
Wed, 04 August 2010 13:06  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Fermiona Fermiona writes:
> If I have an array and I want to select say, the first n elements
> thereof, can I do so without using a loop.
>
> For example if I want to select all the elements, I'd use an *
subarrar = array[0:n]
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|