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

Home » Public Forums » archive » IDL array subscripting issue
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: IDL array subscripting issue [message #90228 is a reply to message #90225] Thu, 12 February 2015 10:05 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David B writes:

>
> Now this is probably a simple and quick problem for someone with experience. I think I may have missed the point or fallen victim to a problem with an obvious solution.
> ===============================
>
> IDL> a = INDGEN(10)
> IDL> b = [0,10]
> IDL> print, a[b]
> 0 9
> IDL> b = [0,9]
> IDL> print, a[b]
> 0 9
>
> ===============================
> Why?!

Here is an explanation:

http://www.idlcoyote.com/code_tips/oobindices.html

This can be a particularly pernicious "bug" to track down in your code.
Personally, I've lost a lot of hair over this one. :-(

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Variable attributes and undef vars
Next Topic: CURVFIT with XY error

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

Current Time: Wed Oct 08 17:10:15 PDT 2025

Total time taken to generate the page: 0.00429 seconds