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

Home » Public Forums » archive » array subscripts
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
array subscripts [message #46397] Mon, 14 November 2005 07:07
sebinjapan is currently offline  sebinjapan
Messages: 14
Registered: June 2004
Junior Member
Hi,

Hi,

I found a strange feature when using out of bounds subscripts.
I am using IDL 6.2 for Mac OSX
there is a short example:

IDL> a=indgen(4)
IDL> print, a[-1]
% Attempt to subscript A with <INT ( -1)> is out of range.
% Execution halted at: $MAIN$

that's ok, but that happens if we use the array [-1] instead of the scalar
-1 as the subscript address

IDL> print, a[[-1]]
0

well... looks like print, a[ 0 > [-1] ]

Same idea for "too large" subscripts
IDL> print, a[4]
% Attempt to subscript A with <INT ( 4)> is out of range.
% Execution halted at: $MAIN$
IDL> print, a[[4]]
3

IDL> print, a[indgen(8)-2]
0 0 0 1 2 3 3 3
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: make .dll share image file for CALL_EXTERNAL
Next Topic: array subscripts

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

Current Time: Wed Oct 08 15:27:20 PDT 2025

Total time taken to generate the page: 0.00909 seconds