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

Home » Public Forums » archive » User selectable lower array bound?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
User selectable lower array bound? [message #25981] Thu, 02 August 2001 14:47 Go to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Hey there,

Is is just me, or would anyone else find useful the ability to define arrays in IDL such
that the lower bound is *not* always zero? Sorta like:

x = FINDGEN( 11, LOWER = -5 )
or
y = DBLARR( 100, LOWER = 1 )

so that accessing elements such as x[ -4 ] or y[ 100 ] are o.k.?

I know this can be done now with judicious use of proxy indices, e.g.

FOR i = -5, 5 DO BEGIN
ix = i + 5
PRINT, x[ ix ]
....do other stuff with negative i's....
ENDFOR

but sometimes this makes code hard to follow (or explain to someone who's never used the
code before) in direct correspondence with a physical process.

It seems like such a simple thing to be able to do (with default action being start at
index 0) although I'm sure the amount of work required to implement this would be
horrendous. Still, it shur would be nice.....

paulv

--
Paul van Delst A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP Drink deep, or taste not the Pierian spring;
Ph: (301)763-8000 x7274 There shallow draughts intoxicate the brain,
Fax:(301)763-8545 And drinking largely sobers us again.
Alexander Pope.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL virtual reality (was 3D Object IDL )
Next Topic: problem getting values from cw_bgroup normal base

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

Current Time: Wed Oct 08 15:05:39 PDT 2025

Total time taken to generate the page: 0.32494 seconds