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

Home » Public Forums » archive » Re: Oh No...
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: Oh No... [message #53588 is a reply to message #53500] Wed, 18 April 2007 11:01 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Apr 18, 7:45 am, Paolo Grigis <pgri...@astro.phys.ethz.ch> wrote:
> FĂ–LDY Lajos wrote:
>
>> No, invalid code, with undefined result :-)

I don't think it invalid or undefined (very confusing, yes). a is
created and used to index itself following the "normal" rules of
indexing in IDL.

Remember that it is valid to use an index array that has indices out
of range, they are simply brought back into range:

IDL> b = findgen(10)
IDL> b[[-1, 20]] = 1
IDL> print, b
1.00000 1.00000 2.00000 3.00000 4.00000
5.00000 6.00000
7.00000 8.00000 1.00000

You can turn this behavior off with COMPILE_OPT:

IDL> compile_opt strictarrsubs
IDL> a[(a=2*findgen(10))]=1
% Array used to subscript array contains out of range subscript: A.
% Execution halted at: $MAIN$

Mike
--
www.michaelgalloy.com
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Text in plots
Next Topic: Oh No...

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

Current Time: Fri Oct 10 22:02:17 PDT 2025

Total time taken to generate the page: 0.16144 seconds