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

Home » Public Forums » archive » Array subscript question
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 subscript question [message #19225] Thu, 02 March 2000 00:00
bowman is currently offline  bowman
Messages: 121
Registered: September 1991
Senior Member
Can someone explain this behavior to me? I can't find anything in the
documentation that states that repeated subscripts are handled
differently.

IDL> a = FINDGEN(5)
IDL> i = [1, 2, 3]
IDL> a[i] = a[i] + 10.0
IDL> PRINT, a
0.00000 11.0000 12.0000 13.0000 4.00000

This is the behavior I expect.


IDL> a = FINDGEN(5)
IDL> i = [2, 2, 2]
IDL> a[i] = a[i] + 10.0
IDL> PRINT, a
0.00000 1.00000 12.0000 3.00000 4.00000

Why does it only do the operation *once* when
IDL> HELP, a[i]
<Expression> FLOAT = Array[3]



IDL> a = FINDGEN(5)
IDL> i = [2, 2, 2]
IDL> a[i] = a[i] + [10.0, 10.0, 10.0]
IDL> PRINT, a
0.00000 1.00000 12.0000 3.00000 4.00000

Even this doesn't help.

Ken

--
Dr. Kenneth P. Bowman, Professor 409-862-4060
Department of Meteorology 409-862-4466 fax
Texas A&M University bowmanATcsrp.tamu.edu
College Station, TX 77843-3150 Replace AT with @
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Newbie Mac PPC shared lib
Next Topic: Newbie Mac PPC shared lib

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

Current Time: Fri Oct 10 13:14:54 PDT 2025

Total time taken to generate the page: 2.16110 seconds