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

Home » Public Forums » archive » Question about using an array as an index
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
Question about using an array as an index [message #6487] Wed, 26 June 1996 00:00
David Schwab is currently offline  David Schwab
Messages: 2
Registered: June 1996
Junior Member
Can anyone explain why these two codes produce different results?

IDL> a=[0,1,1,2,2,2]
IDL> b=intarr(3)
IDL> b(a)=b(a)+1
IDL> print,b
1 1 1
and

IDL> a=[0,1,1,2,2,2]
IDL> b=intarr(3)
IDL> for i=0,5 do b(a(i))=b(a(i))+1
IDL> print,b
1 2 3

Thanks!
--
Dr. David J. Schwab
NOAA Great Lakes Environmental Research Laboratory
2205 Commonwealth Blvd.
Ann Arbor, MI 48105
313-741-2120
313-741-2055 (FAX)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Question about using an array as an index
Next Topic: unpacking HRPT in IDL/ENVI

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

Current Time: Wed Oct 08 15:40:11 PDT 2025

Total time taken to generate the page: 0.00484 seconds