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

Home » Public Forums » archive » negative array index in IDL8
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: negative array index in IDL8 [message #86382 is a reply to message #86380] Sat, 02 November 2013 07:43 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
chu xiangning writes:

> On Friday, November 1, 2013 3:18:24 PM UTC-7, wlandsman wrote:
>> Not the answer to the question you are asking, but if you are only using IDL8 or above, you could mindlessly add /NULL to all your WHERE() statements ( or write a simple script to do this). This is likely easier than adding tests for negative indices. --Wayne
>
> Thanks for the solution. It is ok for new codes. It is all the codes and packages already written that might return wrong results with IDL 8. And we can afford to change them. One simple solution is 'don't buy IDL 8'.

Yes, this will work for awhile, but not for too much longer. Sooner or
later someone you know who uses your software will have IDL 8 and then
the problem will reappear. :-)

This was a controversial decision when it was first contemplated. But,
put yourself in the place of the IDL developers. You want to make your
software fresh and relevant, and you want it to have some of the same
kind of features newer programming languages have. Here is a change you
can make that will make a great many people pleased and it can be done
without harming backwards compatibility for most of the programmers you
know personally (i.e., those professional programmers that understand
how the Where function works and don't rely on IDL errors to do their
programming for them).

What would you have done? It's a pretty close call for me. But, I
understand why you might decide not to let past bad programming
practices interfere with your need to improve the language. I don't hold
this decision against the folks at ExelisVis. And, in the positive
column, giving people incentive to write programs correctly might
actually pay off in the long run. ;-)

I say use a Grep program to search for instances of Where in your IDL
program library and spend a half a day fixing the damn things. It will
cost you half a day now, but you will be glad you did it for a long,
long time.

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
Read Message
Read Message
Read Message
Previous Topic: derivative function in IDL similar as DIFF in matlab
Next Topic: covariance matrix

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

Current Time: Sat Oct 11 14:49:06 PDT 2025

Total time taken to generate the page: 1.43875 seconds