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

Home » Public Forums » archive » Re: populating an array
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: populating an array [message #48164 is a reply to message #48163] Thu, 30 March 2006 11:15 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
subir.vasanth@gmail.com writes:

> I was wondering if there was a more efficient way to populate an array
> created using the MAKE_ARRAY function. This is how I am populating the
> array right now -
>
> data = BYTARR(202000L)
> ; populate byte array with valid data from some input source
> array = MAKE_ARRAY(1000,101, Type = 2)
> offset = 0L
> FOR k = 0L, 100999L DO BEGIN
> array(k) = FIX(data, offset)
> offset = offset + 2
> ENDFOR
>
> Is there a way I can populate 'array' without using a loop to populate
> each element, and instead do a array = FIX(data)??

Say what!?

What do you think this code does, exactly? It looks to me
like it creates a 1000 by 101 array filled with integer
zeros. It would be easier to do this:

array = IntArr(1000, 101)

But this seems so obvious, that I think I am missing
the intent of the question. Could you please elaborate
some more?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: populating an array
Next Topic: Re: Anything in IDL like R's Copy to Clipboard As a Metafile?

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

Current Time: Fri Oct 10 21:59:02 PDT 2025

Total time taken to generate the page: 0.00282 seconds