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

Home » Public Forums » archive » Re: Retrieving elements of function returns
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Retrieving elements of function returns [message #41813] Thu, 25 November 2004 05:43
Ben Panter is currently offline  Ben Panter
Messages: 102
Registered: July 2003
Senior Member
Paolo Grigis wrote:

> This is documented in the manual "Building IDL Applications",
> Chapter 6, Section Array Subscripts, p.123 in the IDL 6.0 version.

Thanks Paolo, David -- that's great news.\

Ben


--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Ben Panter, Garching, Germany
email via www.benpanter.co.uk
Re: Retrieving elements of function returns [message #41815 is a reply to message #41813] Thu, 25 November 2004 05:03 Go to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
Ben Panter wrote:
> Hello All,
>
> Bit of an odd request this. I've recently found that I can take the
> nth element of a returned array by enlosing the function in brackets and
> then appending an array subscript:
>
> n_pix=(size(grid))[1]
>
> which is a bit neater than
>
> n_pix=size(grid)
> n_pix=n_pix[1]
>
> I've had a look though the online help, and I can't decide if this is a
> reasonable thing to do or not -- primarily I'm concerned that this is
> some sort of undocumented feature which may disappear in later versions.
>
> Can someone reassure me that it's ok?!

This is documented in the manual "Building IDL Applications",
Chapter 6, Section Array Subscripts, p.123 in the IDL 6.0 version.


Ciao,
Paolo

>
> Cheers,
>
> Ben
>

--
____________________________________________________________ ________

Paolo Grigis
ETHZ - Institute of Astronomy email: pgrigis@astro.phys.ethz.ch
Scheuchzerstrasse 7
ETH Zentrum phone: ++41 1 632 42 20
8092 Zurich fax : ++41 1 632 12 05
Switzerland http://www.astro.phys.ethz.ch/
____________________________________________________________ ________
Re: Retrieving elements of function returns [message #41816 is a reply to message #41815] Thu, 25 November 2004 05:03 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ben Panter writes:

> Bit of an odd request this. I've recently found that I can take the
> nth element of a returned array by enlosing the function in brackets and
> then appending an array subscript:
>
> n_pix=(size(grid))[1]
>
> which is a bit neater than
>
> n_pix=size(grid)
> n_pix=n_pix[1]
>
> I've had a look though the online help, and I can't decide if this is a
> reasonable thing to do or not -- primarily I'm concerned that this is
> some sort of undocumented feature which may disappear in later versions.
>
> Can someone reassure me that it's ok?!

Oh, this is perfectly OK, although the syntax does become
a bit C-ish for some people's taste. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Retrieving elements of function returns
Next Topic: Sonograms in IDL?

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

Current Time: Wed Oct 08 17:39:19 PDT 2025

Total time taken to generate the page: 0.00666 seconds