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

Home » Public Forums » archive » Re: negative indices, am I missing something here?
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 indices, am I missing something here? [message #81987 is a reply to message #81986] Fri, 02 November 2012 15:26 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 11/2/12 3:53 PM, David Fanning wrote:
> fawltylanguage@gmail.com writes:
>
>> Array subscripts are always clipped. From IDL help:
>>
>> "If an element of the subscript array is less than or equal to zero, the first element of the subscripted array is selected. ...
>>
>> Note: Because of the confusion between the clipping of array subscripts and the use of negative indices (see the next section), it is best to avoid using code that relies on this clipping behavior."
>
> You can think of it as karmic justice for sins of the past. ;-)
>
> Cheers,
>
> David
>
>

Might be a good idea to use

compile_opt strictarrsubs

to catch these cases.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: change values of structure variable
Next Topic: use of temporary in IDL

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

Current Time: Mon Oct 13 02:14:31 PDT 2025

Total time taken to generate the page: 1.20505 seconds