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

Home » Public Forums » archive » Re: what is the highest subscript in the array?!?
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: what is the highest subscript in the array?!? [message #70770 is a reply to message #70769] Thu, 06 May 2010 21:21 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 5/6/10 8:44 pm, munka wrote:
> On May 6, 9:26 pm, Michael Galloy<mgal...@gmail.com> wrote:
>> munka<mynameismu...@gmail.com> wrote:
>>> Hello team,
>>
>>> I find myself wanting to use the highest subscript in an array and
>>> coding "flux[n_elements(flux)-1]"... I seem to remember seeing a
>>> shortcut on here, and I can't remember what it is.
>>
>> You are stuck using that until IDL 8.0 comes out, then you can use -1.
>>
>> Mike
>> --www.michaelgalloy.com
>> Research Mathematician
>> Tech-X Corporation
>
> :(
> -1 doesn't even work.
>
> Also, clicking on your signature link brings me to "http://
> www.google.com/www.michaelgalloy.com" :\

You need IDL 8.0:

IDL> a = findgen(10)
IDL> print, a[-1]
9.00000
IDL> print, a[-2]
8.00000

Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: passing an idl function to a c-code ?
Next Topic: Re: Plotting spherical slice surfaces

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

Current Time: Sat Oct 11 17:21:07 PDT 2025

Total time taken to generate the page: 0.00881 seconds