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

Home » Public Forums » archive » Re: Simple IDL array bound checking bug
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
Re: Simple IDL array bound checking bug [message #7019] Fri, 13 September 1996 00:00
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
William Connolley wrote:
> How on earth doees IDL fail to spot the following array bound violation?
> wmc> data=fltarr(1)
> ; Case 1 - OK
> wmc> print,data(2)
> % Attempt to subscript DATA with <INT ( 2)> is out of range.
> % Execution halted at: $MAIN$
> ; Case 2 - blithely prints junk
> wmc> print,data([2])
> 0.00000

This is explained on page 5-5 of the IDL 4.0.1 User's Guide,
"Array Subscripts". I quote:

"If an element of the subscript array is less than or equal to zero, the
first element of the subscripted variable is selected. If an element of
the subscript is greater than or equal to the last subscript in the
subscripted variable (N, above), the last element is selected. "

Cheers,
Liam.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: DFPMIN problem
Next Topic: Having problems with IDL for Linux

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

Current Time: Wed Oct 08 17:02:42 PDT 2025

Total time taken to generate the page: 0.00505 seconds