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

Home » Public Forums » archive » subsripting array problem
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
subsripting array problem [message #16453] Mon, 26 July 1999 00:00
Med Bennett is currently offline  Med Bennett
Messages: 109
Registered: April 1997
Senior Member
Hi All,

I am just wondering why the following does not work correctly:

timeidx = round(traveltime/100.)-1 ;get index of array
timeidx = timeidx[0]
if timeidx ge 0 and timeidx le 199 then $
gwfluxpa[timeidx:*] = gwfluxpa[timeidx:*] + ic*2500.

If I rewrite this code to the following, it works OK:

timeidx = round(traveltime/100.)-1 ;get index of array
timeidx = timeidx[0]
if timeidx ge 0 and timeidx le 199 then begin
junk = fltarr(200)
junk[timeidx:*] = ic*2500.
gwfluxpa = gwfluxpa + junk
endif

In the first version, the contents of my gwfluxpa array get reset
to zero every so often as the procedure executes this section.
Any ideas?
[Message index]
 
Read Message
Previous Topic: Re: Complex -> Real FFT
Next Topic: Re: Porting Unix to NT problem 2 - mapping buttons over draw space

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

Current Time: Sat Oct 11 02:32:40 PDT 2025

Total time taken to generate the page: 0.09539 seconds